Select rows from a DataFrame based on values in a column in pandas,print(df.loc[df['A'] == 'foo'])