TypeError: loop of ufunc does not support argument 0 of type float which has no callable radians met

目录


遇到了下面的这个问题:

TypeError: loop of ufunc does not support argument 0 of type float which has no callable radians method

经查询了解到:

查询得知问题是数据列不是数值类型,而 np.log() 函数需要输入数值数据。查看我的数据发现数据对象均为 object,因此需要将数据框中的 object 数据转换为 float 类型,

进行如下操作:

df = pd.DataFrame(df, dtype=float)
print(np.log(df))

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
xiaoxingxing的头像xiaoxingxing管理团队
上一篇 2023年11月23日
下一篇 2023年11月23日

相关推荐