I'd like to use numpy to calculate the inverse. But I'm getting an error:
'numpy.ndarry' object has no attribute I
To calculate inverse of a matrix in numpy, say matrix M, it should be simply:
print M.I
Here's the code:
x = numpy.empty((3,3), dtype=int)
for comb in combinations_with_replacement(range(10), 9):
x.flat[:] = comb
print x.I
I'm presuming, this error occurs because x is now flat, thus 'I
' command is not compatible. Is there a work around for this?
My goal is to print the INVERSE MATRIX of every possible numerical matrix combination.
np.matrix(x)
so that the.I
method is available.