![Learning pandas(Second Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/993/36700993/b_36700993.jpg)
上QQ阅读APP看书,第一时间看更新
The size and shape of a Series
The number of items in a Series object can be determined by several techniques, the first of which is by using the Python len() function:
![](https://epubservercos.yuewen.com/77D4E0/19470406901634306/epubprivate/OEBPS/Images/4873ca3c-04c1-4614-933c-0b3f5fdd2e71.png?sign=1739326227-slAcXtkRhWeAwAEz5dAdTbPIwI7ohjxu-0-e8552e9cc5ece3aa96fdde1187b739a9)
The same result can be obtained by using the .size property:
An alternate form for getting the size of a Series is to use the .shape property. This returns a two-value tuple, but with only the first value specified and representing the size:
![](https://epubservercos.yuewen.com/77D4E0/19470406901634306/epubprivate/OEBPS/Images/dcd3e80a-eaf4-4b4d-aed7-720214fa5778.png?sign=1739326227-a7Qr6ECC8gFB2Li2sJDDRfHMmPa3fQbB-0-6f1853482dac8fcc34694831b40c2ded)