![Learning pandas(Second Edition)](https://wfqqreader-1252317822.image.myqcloud.com/cover/993/36700993/b_36700993.jpg)
上QQ阅读APP看书,第一时间看更新
Explicit lookup by position with .iloc[]
Value lookup by position can be performed using .iloc[]. The following demonstrates using integers as parameters:
![](https://epubservercos.yuewen.com/77D4E0/19470406901634306/epubprivate/OEBPS/Images/9fa5238e-4c8a-4a3c-a10e-b50435b84916.png?sign=1738912865-WHZwEyQPcIp2WY2XlI5Ag315IPZj8GLb-0-10a0c1d18f68f7195f04d9aecaa8b7be)
The following looks up by position, even though the index has integer labels:
![](https://epubservercos.yuewen.com/77D4E0/19470406901634306/epubprivate/OEBPS/Images/7caf6392-0e60-4ff1-9e0d-7d22e70262f2.png?sign=1738912865-H7C9B7CnadYLjZbqMEzTNE4qWotgzIaP-0-5bbbf5748ddf1a4fc93fdcdf6552dbe6)
Note that if you specify a location that does not exist (below zero, or greater than the number of items—one), then an exception will be thrown.