티스토리 뷰

728x90
df.loc[df['channel'].isin(['sale','fullprice'])]

https://stackoverflow.com/questions/45803676/python-pandas-loc-filter-for-list-of-values

 

python pandas loc - filter for list of values

This should be incredibly easy, but I can't get it to work. I want to filter my dataset on two or more values. #this works, when I filter for one value df.loc[df['channel'] == 'sale'] #if I h...

stackoverflow.com

 

728x90
댓글
댓글쓰기 폼