This illustrates a failure, which is reported later in the calculation:
A2= np.matrix([[1, 2, -2], [-3, -1, 4], [4, 2 -6]])
Here 2 - 6 is treated as an expression.
Wikipedia offers:
In mathematics, a matrix (plural matrices) is a rectangular array[1] of numbers, symbols, or expressions, arranged in rows and columns.[2][3] The individual items in a matrix are called its elements or entries. An example of a matrix with 2 rows and 3 columns is
Colin W.