1、通过loc使用isin、==或!=查询方法
df.loc[df['column_name'] == some_value]
df.loc[df['column_name'] != some_value]
df.loc[df['column_name'].isin(some_values)]
df.loc[~df['column_name'].isin(some_values)]
2、根据列(column)值选择查找行(row)示例代码
import pandas as pd
import numpy as np
df = pd.DataFrame({'A': 'foo bar foo bar foo bar foo foo'.split(),
'B': 'one one two three two two one three'.split(),
'C': np.arange(8), 'D': np.arange(8) * 2})
print(df)
print(df.loc[df['A'] == 'foo'])
print(df.loc[df['B'].isin(['one','three'])])
df = df.set_index(['B'])
print(df.loc['one'])
print(df.loc[df.index.isin(['one','two'])])