select rows of dataframe `df` whose value for column `a` is `foo`,print(df.loc[df['A'] == 'foo'])