如何在python中修复未指定矩阵

时间:2019-06-29 14:22:12

标签: python

在这里输入我的代码

    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)

有解决方案吗?

0 个答案:

没有答案