assert np.all(list(filter(df, 1)) == df)
assert np.all(list(filter(df, [1, 0], 'A', 'B')) == df[(df.A == 1) & (df.B == 0)])
pandas: Is it possible to filter a dataframe with arbitrarily long boolean criteria?