二维计算的时候没有问题,单行计算时出现报错.
下面是np1的值
AttributeError: 'numpy.float64' object has no attribute 'arctan'
[ 0.89408466 0.50343803 -0.29518441 -0.17965822 -0.08599373 0.03571068
0.124492 ]
复制代码
1np1 = np.arctan(np1)
运行后报错,改为
复制代码
1np1 = np.arctan(np1.tolist())
复制代码
1正常结果
0 1 2 3 4 5 6
0 51.0 29.0 -17.0 -10.0 -5.0 2.0 7.0
最后
以上就是着急太阳最近收集整理的关于numpy 弧度函数arctan()计算报错解决方法的全部内容,更多相关numpy内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复