在使用了numpy函数atan2之后,我得到了下一个错误:
Traceback (most recent call last):
File "<module1>", line 31, in <module>
File "<module1>", line 22, in f
File "<module1>", line 9, in ATN
ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()
这是我正在使用的代码
^{2}$我用函数ATN(y,x)得到的数值是正确的,但是我不知道如何处理这个模糊性问题
您正在将数组传递给
ATN
函数,因此需要处理调用np.arctan2
返回的数组,请尝试以下操作:另一种解决方案是使用模运算符:
或者等效
^{pr2}$相关问题 更多 >
编程相关推荐