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

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:

主站蜘蛛池模板: 建宁县| 清远市| 大厂| 安泽县| 南昌县| 山东省| 横山县| 江华| 隆化县| 安宁市| 井冈山市| 抚松县| 白朗县| 巴楚县| 博乐市| 子长县| 澄江县| 慈利县| 乌兰浩特市| 富阳市| 大姚县| 敦煌市| 抚顺县| 威海市| 米脂县| 兴仁县| 福贡县| 罗山县| 宜昌市| 固安县| 辛集市| 大兴区| 孝感市| 综艺| 安岳县| 吉首市| 临漳县| 德庆县| 金坛市| 榆中县| 密山市|