code: def apply_filters(df, filters):
          
          idx = pd.Series([True]*df.shape[0])
          for k, v in list(filters.items()):
              if k not in df.columns:
                  continue
              idx &= (df[k] == v)
  
          return df.loc[idx]
docs: Basic filtering for a dataframe.