def resample(df, rule, on=None, groupby=(), aggregation='mean', reset_index=True, time_index=None):
    'pd.DataFrame.resample adapter.\n\n    Call the `df.resample` method on the given time_index\n    and afterwards call the indicated aggregation.\n\n    Optionally group the dataframe by the indicated columns before\n    performing the resampling.\n\n    If groupby option is used, the result is a multi-index datagrame.\n\n    Args:\n        df (pandas.DataFrame):\n            DataFrame to resample.\n        rule (str or int):\n            The offset string or object representing target conversion or an\n            integer value that will be interpreted as the number of seconds.\n        on (str or None):\n            Name of the column to use as the time index. If ``None`` is given, the\n            DataFrame index is used.\n        groupby (list):\n            Optional list of columns to group by.\n        aggregation (callable or str):\n            Function or name of the function to use for the aggregation. If a name is given, it\n            can either be one of the standard pandas aggregation functions or the fully qualified\n            name of a python function that will be imported and used.\n        reset_index (bool):\n            Whether to reset the index after aggregating\n        time_index (str or None):\n            Deprecated: This has been renamed to `on`.\n            Name of the column to use as the time index. If ``None`` is given, the\n            DataFrame is index is used.\n\n    Returns:\n        pandas.Dataframe:\n            resampled dataframe\n    '
    if ((on is None) and (time_index is not None)):
        message = 'resample `time_series` argument deprecated and will be removed in future versions of MLPrimitives. Please use `on` instead.'
        warnings.warn(message, DeprecationWarning, stacklevel=2)
        on = time_index
    if groupby:
        df = df.groupby(groupby)
    if isinstance(rule, int):
        rule = '{}s'.format(rule)
    dtir = df.resample(rule, on=on)
    if ((not callable(aggregation)) and (aggregation not in _RESAMPLE_AGGS)):
        try:
            aggregation = import_object(aggregation)
        except (AttributeError, ImportError, ValueError):
            pass
    df = dtir.aggregate(aggregation)
    for name in df.index.names:
        if (name in df):
            del df[name]
    if reset_index:
        df.reset_index(inplace=True)
    return df
pd.DataFrame.resample adapter.

Call the `df.resample` method on the given time_index
and afterwards call the indicated aggregation.

Optionally group the dataframe by the indicated columns before
performing the resampling.

If groupby option is used, the result is a multi-index datagrame.

Args:
    df (pandas.DataFrame):
        DataFrame to resample.
    rule (str or int):
        The offset string or object representing target conversion or an
        integer value that will be interpreted as the number of seconds.
    on (str or None):
        Name of the column to use as the time index. If ``None`` is given, the
        DataFrame index is used.
    groupby (list):
        Optional list of columns to group by.
    aggregation (callable or str):
        Function or name of the function to use for the aggregation. If a name is given, it
        can either be one of the standard pandas aggregation functions or the fully qualified
        name of a python function that will be imported and used.
    reset_index (bool):
        Whether to reset the index after aggregating
    time_index (str or None):
        Deprecated: This has been renamed to `on`.
        Name of the column to use as the time index. If ``None`` is given, the
        DataFrame is index is used.

Returns:
    pandas.Dataframe:
        resampled dataframe
def resample(df, rule, on=None, groupby=(), aggregation='mean', reset_index=True, time_index=None):
    'pd.DataFrame.resample adapter.\n\n    Call the `df.resample` method on the given time_index\n    and afterwards call the indicated aggregation.\n\n    Optionally group the dataframe by the indicated columns before\n    performing the resampling.\n\n    If groupby option is used, the result is a multi-index datagrame.\n\n    Args:\n        df (pandas.DataFrame):\n            DataFrame to resample.\n        rule (str or int):\n            The offset string or object representing target conversion or an\n            integer value that will be interpreted as the number of seconds.\n        on (str or None):\n            Name of the column to use as the time index. If ``None`` is given, the\n            DataFrame index is used.\n        groupby (list):\n            Optional list of columns to group by.\n        aggregation (callable or str):\n            Function or name of the function to use for the aggregation. If a name is given, it\n            can either be one of the standard pandas aggregation functions or the fully qualified\n            name of a python function that will be imported and used.\n        reset_index (bool):\n            Whether to reset the index after aggregating\n        time_index (str or None):\n            Deprecated: This has been renamed to `on`.\n            Name of the column to use as the time index. If ``None`` is given, the\n            DataFrame is index is used.\n\n    Returns:\n        pandas.Dataframe:\n            resampled dataframe\n    '
    if ((on is None) and (time_index is not None)):
        message = 'resample `time_series` argument deprecated and will be removed in future versions of MLPrimitives. Please use `on` instead.'
        warnings.warn(message, DeprecationWarning, stacklevel=2)
        on = time_index
    if groupby:
        df = df.groupby(groupby)
    if isinstance(rule, int):
        rule = '{}s'.format(rule)
    dtir = df.resample(rule, on=on)
    if ((not callable(aggregation)) and (aggregation not in _RESAMPLE_AGGS)):
        try:
            aggregation = import_object(aggregation)
        except (AttributeError, ImportError, ValueError):
            pass
    df = dtir.aggregate(aggregation)
    for name in df.index.names:
        if (name in df):
            del df[name]
    if reset_index:
        df.reset_index(inplace=True)
    return df