官术网_书友最值得收藏!

Heads, tails, and takes

pandas provides the .head() and .tail() methods to examine the first (head) or last (tail) few rows in a Series. By default, these return the first or last five rows, but this can be changed using the n parameter.

Let's examine the usage given the following Series:

The following retrieves the first five rows:

The number of items can be changed using the n parameter (or just by specifying the number):

.tail() returns the last five rows:

It works similarly when specifying a number other than 5:

The .take() method returns the rows in a series at the specified integer position:

主站蜘蛛池模板: 英山县| 信宜市| 宁安市| 嫩江县| 绥棱县| 南昌县| 旺苍县| 永清县| 洛阳市| 双柏县| 安顺市| 兴安盟| 福安市| 类乌齐县| 淮安市| 新化县| 永福县| 清丰县| 浏阳市| 牟定县| 广水市| 桑植县| 双辽市| 新巴尔虎左旗| 行唐县| 镇原县| 石河子市| 吐鲁番市| 南充市| 盈江县| 鹤峰县| 图木舒克市| 玉溪市| 鸡西市| 二手房| 华容县| 黑龙江省| 武功县| 郧西县| 井陉县| 仁怀市|