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

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:

主站蜘蛛池模板: 道孚县| 东山县| 宝山区| 五常市| 双峰县| 桃园市| 辽阳县| 白玉县| 马边| 襄樊市| 南丹县| 大荔县| 隆德县| 屏边| 新疆| 嘉善县| 同仁县| 尼木县| 广汉市| 天水市| 桃园县| 息烽县| 廉江市| 日照市| 嘉荫县| 印江| 醴陵市| 沂水县| 阿拉善右旗| 海门市| 达拉特旗| 盐池县| 寻甸| 新野县| 太保市| 吴川市| 吐鲁番市| 九龙县| 锡林郭勒盟| 庆城县| 铁力市|