def using_mstats_df(df):
    return df.apply(using_mstats, axis=0)

def using_mstats(s):
    return mstats.winsorize(s, limits=[0.05, 0.05])
N, M, P = 10 ** 5, 10, 10 ** 2
dates = pd.date_range('2001-01-01', periods=N // P, freq='D').repeat(P)
df = pd.DataFrame(np.random.random((N, M)), index=dates)
df.index.names = ['DATE']
grouped = df.groupby(level='DATE')
Faster way to remove outliers by group in large pandas DataFrame