Query Pandas Dataframe Index

code base 5000

I have a simple index on my Dataframe (integers from 0:n).

If I want row index values 1,10,100, how do I query the index to get only those rows back?

Thanks

gzc

In your case, the index equals to integer position. Thus you can use either .loc or .iloc.

.loc is primarily label based...

.iloc is primarily integer position based (from 0 to length-1 of the axis)

See different-choices-for-indexing

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related