from functools import reduce
def filter(df, value, *columns):
    return df.loc[reduce(and_, (df[column] == value for column in columns))]
pandas: Is it possible to filter a dataframe with arbitrarily long boolean criteria?