def smooth(df, window_len=11, window="hanning"):
    """Smooth the data using a window with requested size."""
    if isinstance(df, pd.Series):
        new_df = _smooth(df, window_len=window_len, window=window)
    else:
        new_df = df.apply(_smooth, window_len=window_len, window=window)
    return new_df