- 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:

推薦閱讀
- Mobile Web Performance Optimization
- Redis入門指南(第3版)
- Computer Vision for the Web
- 深入淺出Spring Boot 2.x
- CKA/CKAD應(yīng)試教程:從Docker到Kubernetes完全攻略
- AutoCAD VBA參數(shù)化繪圖程序開發(fā)與實戰(zhàn)編碼
- Hands-On Reinforcement Learning with Python
- 計算機應(yīng)用基礎(chǔ)教程(Windows 7+Office 2010)
- Scratch趣味編程:陪孩子像搭積木一樣學(xué)編程
- Unity 5.X從入門到精通
- Instant Apache Camel Messaging System
- Learning D
- Hadoop Blueprints
- Java EE輕量級解決方案:S2SH
- H5頁面設(shè)計與制作(全彩慕課版·第2版)