I am trying to create this matrix AxB with a specific pattern in Python :
[1.0, 0.0, 0.0],
[-1.0, 0.0, 0.0],
[0.0, 1.0, 0.0],
[0.0, -1.0, 0.0],
[0.0, 0.0, 1.0],
[0.0, 0.0, -1.0]
The problem is that I want to create this matrix without having to resort to hard coding it. Can someone help me to isolate the pattern, and fill the matrix dynamically?
Here is what I've tried so far :
matrix_test = [[0.0 for i in range(3)] for i in range(6)]
for x in range(3):
matrix_test [x][x] = 1.0