qf

hhpy.ds.qf(df: pandas.core.frame.DataFrame, fltr: Union[pandas.core.frame.DataFrame, pandas.core.series.Series, Mapping[KT, VT_co]], rem_unused_categories: bool = True, reset_index: bool = False)[source]

quickly filter a DataFrame based on equal criteria. All columns of fltr present in df are filtered to be equal to the first entry in filter_df.

Parameters:
  • df – pandas DataFrame to be filtered
  • fltr – filter condition as DataFrame or Mapping or Series
  • rem_unused_categories – whether to remove unused categories from categorical dtype after filtering
  • reset_index – whether to reset index after filtering
Returns:

filtered pandas DataFrame