filter on dictionary value dataframe python code example
Example 1: pandas filter by dictionary
df.loc[df[filter_v.keys()].isin(filter_v.values()).all(axis=1), :]
Example 2: pandas filter by dictionary
>>> df1.loc[(df1[list(filter_v)] == pd.Series(filter_v)).all(axis=1)]
A B C D
3 1 0 right 3