df_players.loc[df_players['Player']=='Vitor Gabriel'][['Points']]
印刷品:
Points
407 0.0
18805 0.0
19634 0.0
20459 7.2
21285 0.0
22111 0.0
22936 0.0
现在如果我这样做:
a1_points = df_players.loc[df_players['Player']=='Vitor Gabriel'][['Points']]
a1_points['RollingAvg'] = a1_points.rolling(window=4, center=False).mean()
我得到一个错误:
ValueError: Cannot set a frame with no defined index and a value that cannot be converted to a Series
我错过了什么
第二行需要先转换为系列
相关问题 更多 >
编程相关推荐