I have a DataFrame and I would select only rows that contain index value into df1.index.
for Example:
In [96]: df
Out[96]:
A B C D
1 1 4 9 1
2 4 5 0 2
3 5 5 1 0
22 1 3 9 6
and these indexes
In[96]:df1.index
Out[96]:
Int64Index([ 1, 3, 4, 5, 6, 7, 22, 28, 29, 32,], dtype='int64', length=253)
I would like this output:
In [96]: df
Out[96]:
A B C D
1 1 4 9 1
3 5 5 1 0
22 1 3 9 6