Skip to content Skip to sidebar Skip to footer

Numpy Matrix Multiplication Error

I have 2 big matrices: Xn = np.matrix(X) Xnt = Xn.transpose() Then Xn is like this: >>> Xn matrix([['0,208', '0,22', '0,208', ..., '0,194', '0,205', '

Solution 1:

Your matrix elements are strings - note dtype='|S5' when you print the matrix. Try converting the elements of X from strings to floats first.


Post a Comment for "Numpy Matrix Multiplication Error"