retain rows based on list pandas code example
Example 1: pandas dataframe select rows not in list
df[~df.isin(subset).iloc[:,0]]
Example 2: pandas filter rows by value in list
df.loc[df['col name'].isin(ls_conditions)]
df[~df.isin(subset).iloc[:,0]]
df.loc[df['col name'].isin(ls_conditions)]