Jun-13-2018, 10:49 PM
Graph = pd.read_csv(file)
Pl = Graph.dropna()
fig = plt.figure()
ax1 = fig.add_subplot(1, 1, 1)
df2 = Pl.filter(regex= 'Mean')
col = df2.loc[: , "Mean1":"Mean14"]
col2 = df2.loc[: , "Mean1":"Mean14"]
Pl['Average'] = col.mean(axis=1)
Pl['Moving'] = col2.rolling(2).mean(axis=1)
df2.plot(ax = ax1)
df3 = Pl.filter(like= 'Aver')
df4 = Pl.filter(like= 'Moving') I then go on to plot df3 and df4 on a twinx() When I do this It gives me the error
"UnsupportedFunctionCall: numpy operations are not valid with window objects. Use .rolling(...).mean() instead " So obviously the rolling mean isnt going to work with df4 but How can I fix this?
Thanks a bunch in Advance!
