def smooth_series(data, window, method="average"):
    """Apply a moving average or mean with window of size "window"
    
    Arguments:
        data {Dataframe} -- Pandas dataframe
        window {int} -- size of window to apply
    
    Keyword Arguments:
        method {str} -- the method applied to smooth the data (default: {"average"})
    
    Returns:
        Dataframe -- the new dataframe
    """
    if method == "average":
        rolled_df = data.rolling(window=window, axis=1, center=True, win_type=None).mean()
    elif method == "median":
        rolled_df = data.rolling(window=window, axis=1, center=True, win_type=None).median()
    else:
        raise ValueError("Unknow method name")

    return rolled_df.dropna(axis=1)