【发布时间】:2020-07-23 22:28:52
【问题描述】:
在这样的数据框中:
df_temp = pd.DataFrame({'Player':['One', 'Two', 'Three'],
'Goals':[1, NaN, 1],
'Assists':[2, NaN, 1],
'ShotBar':[NaN 1, NaN],
'ShotDefended':[NaN, 1, NaN],
'ShotOut':[3, 2, NaN]})
如何将所有NaN 替换为 1,并将所有其他单元格加 1?
【问题讨论】: