def filter_df_options(df, options):
    """
    Filters out rows from a dataframe.

    @param      df          dataframe
    @param      options     options
    @return                 filtered dataframe

    .. runpython::
        :showcode:

        from pymlbenchmark.plotting.plot_helper import filter_df_options
        from pandas import DataFrame
        df = DataFrame([
            dict(i=1, t='aa', x=0.5),
            dict(i=2, t='bb', x=0.5),
            dict(i=2, t='aa', x=0.5),
        ])

        sub = filter_df_options(df, {'i': 1, 't': 'aa'})
        print(sub)

        sub = filter_df_options(df, [None])
        print(sub)
    """
    if options is None:
        return df
    elif isinstance(options, list):
        if options[0] is None:
            return df
        else:
            raise RuntimeError('options must be dictionary or [None] not {}'
                .format(options))
    for k, v in options.items():
        df = df[df[k] == v]
    return df
