Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

pandas isin

# Filter dataframe by multiple values in a column or multiple columns
# SQL equivalent: WHERE columnA IN ('val1', 'val2') AND columnB > 70

df[ (df.columnA.isin(['val1', 'val2'])) & (df['columnB'] > 70) ] 
 
PREVIOUS NEXT
Tagged: #pandas #isin
ADD COMMENT
Topic
Name
8+5 =