
[英]How to fix AttributeError: 'Series' object has no attribute 'to_numpy'
[英]how to fix AttributeError: module 'numpy' has no attribute 'across'
我的代码和输入
import numpy as np
x = np.array([0.707,0.707,0.0])
y = np.array([0.866,0.5,0.0])
xmag = np.linalg.norm(x) #norm of vector
ymag = np.linalg.norm(y)
theta_radians = np.across(np.dot(x,y) / (xmag*ymag))
theta_degrees=(180.0/np.pi)*theta_radians
print(theta_degrees)
如何修复我得到的错误,我正在尝试获取两个向量之间的角度
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.