Jun-13-2018, 10:49 PM
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
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' ) |
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?

