for i in range(len(new_arr)):
new_arr[i] = new_arr[i].transpose()
n = len(arr)
u = [0 * n for i in range(n)]
e = [0 * n for i in range(n)]
print(e)
print ("Q")
Q = []
for i in range(len(arr)):
u[i] = new_arr[i] - ((np.dot(new_arr[i],e[i-1])*e[i-1]))
e[i] = u[i] / norm(u[i])#Cari gapake norm
e[i] = e[i].transpose()
print(u[i])
print(e[i])
但是当我删除
e[i] = e[i].transpose()
出现了这样的错误:
shapes (1,3) and (1,3) not aligned: 3 (dim 1) != 1 (dim 0)
有解决方案吗?