Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas select row by index

#for single row
df.loc[ index , : ]

# for multiple rows
indices = [1, 20, 33, 47, 52 ]
new_df= df.iloc[indices, :]
 
PREVIOUS NEXT
Tagged: #pandas #select #row #index
ADD COMMENT
Topic
Name
9+5 =