def smooth_ts(ts, win=5):
    """
    Underestimate high flows - Overestimate low flows.

    Time series is smoothed by rolling average. Maxima decrease and minima
    decrease.

    Parameters
    ----------
    ts : dataframe
        Time series

    win : int, optional
        Size of window used to apply rolling mean. The default is 5 days.

    Returns
    ----------
    smoothed_ts : series
        Smoothed time series
    """
    smoothed_ts = ts.rolling(window=win).mean()
    smoothed_ts.fillna(method='bfill', inplace=True)
    return smoothed_ts
