filter on dataframe python code example
Example 1: pandas filter rows by value in list
df.loc[df['col name'].isin(ls_conditions)]
Example 2: pandas filter
df[(df['year'] > 2012) & (df['reports'] < 30)]
df.loc[df['col name'].isin(ls_conditions)]
df[(df['year'] > 2012) & (df['reports'] < 30)]