Skip to content Skip to sidebar Skip to footer

Pandas Iloc Returns Different Range Than Loc

I am a bit confused of the iloc function of pandas, because I want to select a range of columns and the output is different than expected. The same will happen to row selection, so

Solution 1:

As it mentioned in docs for loc:

Warning: Note that contrary to usual python slices, both the start and the stop are included

On the other hand, iloc do selects based on integer-location based indexing, so it doesn't include stop index.

Post a Comment for "Pandas Iloc Returns Different Range Than Loc"