pandas select row by index name code example
Example 1: dataframe get row by name
row_data = df.loc[ 'a' , : ]
Example 2: pandas df by row index
indices = [133, 22, 19, 203, 14, 1]
df_by_indices = df.iloc[indices, :]
row_data = df.loc[ 'a' , : ]
indices = [133, 22, 19, 203, 14, 1]
df_by_indices = df.iloc[indices, :]