我试图在所有列都是dtype float64的数据帧中插入NaN值。 虽然默认的“线性”方法有效:
doseframe3 = doseframe2.interpolate(method = 'linear', axis = 1, limit_direction = 'both')
几乎任何其他方法(如“立方”或“二次”)都会抛出类型错误:
TypeError: ufunc 'isnan' not supported for the input types, and the inputs could not be safely coerced to any supported types according to the casting rule ''safe''
我想澄清一下:
我需要帮助。 插值前的数据如下所示: Data before interpolation
我意识到将列名转换为float64不起作用。一旦我成功地做到了这一点,插值工作得很好
关键点似乎是索引的使用(在列内插值时)或列名的使用(在行内插值时)。这不能是对象或str
相关问题 更多 >
编程相关推荐