我试图在数据帧列表上应用fillna(0)
方法,但是for循环似乎没有起作用。基本上,我在一个列表中有4个数据帧,如下所示
Tox=[toxsnaus,toxvom,toxwt,toxanor]
现在,这个列表中的每个数据帧都有一些我想用零填充的nan值,但是当我尝试用for
循环填充它们时
for tx in Tox: #fill all nans
tx=tx.fillna(0)
这实际上并不替换这些值,而是在循环迭代中更改tx的值。我如何获得它,使fillna(0)实际应用于数据帧而不是迭代器tx
谢谢
Tags:
如果您填写了NAN,您的代码应该可以正常工作,即:
请注意,不需要指定任务。有关详细信息,请参见docs
您需要的是将其应用回原始数据帧
相关问题 更多 >
编程相关推荐