How would i format a numpy array of form
data1 = np.array([[0,0,0],[0,1,1],[1,0,1],[1,1,0]])
to a list in this format:
data = [
[[0,0], [0]],
[[0,1], [1]],
[[1,0], [1]],
[[1,1], [0]]
]
I tried using two for loops
for i in range(len(data)):
for j in range(3):
if j == 2:
va[i] = data1[i][j]
else:
sa[i] = data1[i][j]
but that gives me an index out of bounds error. I would love some ideas on how to go about this
vaandsainitialized to?va = []andsa = []but thank you. I got an answer to my question