def filter_rows(filter_query, data):
    """Filter a pandas DataFrame.

    :param filter_query: The query to apply.
    :param data: The DataFrame to apply the query to.
    :return: pandas DataFrame filtered.
    """
    return data.query(filter_query) if filter_query else data