After comparison between an array total= np.full((3,3),[0, 1, 2]) and array a = np.array([1],[0],[1]), I am looking to get a new_array:
array([[0, 2],
[1, 2],
[0, 2]])
You can use list comprehension and np.delete:
import numpy as np
total= np.full((3,3),[0, 1, 2])
a = np.array([[1],[0],[1]])
new_array = np.array([np.delete(l, i) for l,i in zip(total,a)])
result
array([[0, 2],
[1, 2],
[0, 2]])
return np.array([[0, 2], [1, 2], [0, 2]])would also do that. They don't behave the same way as each other on other outputs.