![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=1739316046-RiSxs58lViR8QfOJJwmy48eleyIUOVeH-0-6ec591200dadb430ccb458f9e9be6358)
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=1739316046-lkMqBKSHgp1bSTN9GsWROQziPsCC9Kwk-0-627eca2a38efc0a987bd556b2d053ddc)