你好
我试图使用 an ()来替换缺失的值,但是我仍然得到了一个错误:
gaming.loc[16448, 'year_of_release'].fillna(2012.0, inplace=True)我得到了一个AttributeError:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
/tmp/ipykernel_31/422732767.py in <module>
----> 1 gaming.loc[16448, 'year_of_release'].fillna(2012.0, inplace=True)
AttributeError: 'numpy.float64' object has no attribute 'fillna'发布于 2022-07-06 15:24:36
gaming.loc[x, y]返回单个值,而不是Series或Dataframe。我认为df.loc[[x], [y]] = df.loc[[x], [y]].fillna(2012.0) gaming.loc[[x], [y]]会返回一个副本,而不是执行一个内部操作,您需要进行操作。
https://stackoverflow.com/questions/72886113
复制相似问题