I have a list of lists that I convert into a matrix.
m = [[0, 2, 1, 0, 0], [0, 0, 0, 3, 4], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0], [0, 0, 0, 0, 0]]
n = np.matrix(m)
How do I go about creating a new matrix based on the first three rows and columns?
Specifically, this:
I = [[0, 2, 1], [0, 0, 0], [0, 0, 0]]
I thought the following line would work
I = m[0:3, 0:3]
but I get the error
TypeError: list indices must be integers or slices, not tuple