pandas where get column code example
Example 1: pandas df by row index
indices = [133, 22, 19, 203, 14, 1]
df_by_indices = df.iloc[indices, :]
Example 2: selecting items in a column of a dataframe
df.loc[df['column_name'] == some_value]
indices = [133, 22, 19, 203, 14, 1]
df_by_indices = df.iloc[indices, :]
df.loc[df['column_name'] == some_value]