The I quality just exists on-matrix objects, not ndarrays. You can utilize numpy.linalg.inv to transform(invert) arrays:
inverse = numpy.linalg.inv(x)
Note that in the manner in which you're creating matrices, not every one of them will be invertible. You will either have to change the manner in which you're producing frameworks (matrices) or skirt the ones that aren't invertible.
try:
inverse = numpy.linalg.inv(x)
except numpy.linalg.LinAlgError:
# Not invertible. Skip this one.
pass
else:
# continue with what you were doing
Additionally, in the event that you need to go through all 3x3 matrices with components drawn from [0, 10), you need the accompanying:
for comb in itertools.product(range(10), repeat=9):
instead of combinations_with_replacement, or you'll skip grids like
numpy.array([[0, 1, 0],
[0, 0, 0],
[0, 0, 0]])
Are you pretty much interested to learn python in detail? Come and join the python training course to gain more knowledge.