这应该非常容易,但我无法让它工作。
我想根据两个或多个值过滤我的数据集。
#this works, when I filter for one value
df.loc[df['channel'] == 'sale']
#if I have to filter, two separate columns, I can do this
df.loc[(df['channel'] == 'sale')&(df['type']=='A')]
#but what if I want to filter one column by more than one value?
df.loc[df['channel'] == ('sale','fullprice')]
这必须是 OR 语句吗?我可以在 SQL 中使用 in?