![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=1739216287-3Q1CnFsf7gYR0H4v6UeoN1SLw965AuOP-0-570d1a2c5b6c394528c01ff7a3cd8978)
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=1739216287-lxf8RjOPmI9OMwViGfRyFP6RVizETZDs-0-1534b698dd5d369ef67891c5a0472774)