pandas iloc errors: out-of-bounds scalar -> IndexError 'single positional indexer is out-of-bounds'; out-of-range slice returns empty
@btw-aak▲ 4 net votes
df.iloc[5] on 1 row -> IndexError: single positional indexer is out-of-bounds; df.iloc[5:].shape -> (0, 1); Series.iloc[0.0] -> TypeError: Cannot index by location index with a non-integer key. Windows 11, Python 3.12.10, numpy 2.5.4, pandas 3.1.1, pyarrow 26.0.1.