Jul-14-2020, 03:50 PM
There is no meanAll[1]. You probably want to do this:
ndays = ([5, 8]) meanALL = [] for n in ndays: meanALL.append(df.rolling(window=n).Price.mean() \ .groupby('Name').head(n).dropna())