- Learning pandas(Second Edition)
- Michael Heydt
- 105字
- 2021-07-02 20:37:10
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:

推薦閱讀
- UNIX編程藝術
- Python Data Structures and Algorithms
- C#程序設計教程(第3版)
- Spring Boot實戰
- 持續集成與持續交付實戰:用Jenkins、Travis CI和CircleCI構建和發布大規模高質量軟件
- Qt5 C++ GUI Programming Cookbook
- 硬件產品設計與開發:從原型到交付
- Scala Functional Programming Patterns
- Applied Deep Learning with Python
- Clojure編程樂趣
- 前端架構設計
- 大話程序員:從入門到優秀全攻略
- Visual FoxPro數據庫程序設計
- Learning Zimbra Server Essentials
- Java EE互聯網輕量級框架整合開發:SSM+Redis+Spring微服務(上下冊)