Given two arrays as such
a = np.array([0,1,0,1,0,0])
b = np.array([0,0,1,1,1,0])
I want to create a numpy array based on conditions as
output = np.zeros(len(arr1))
for i in range(0, len(arr1)):
if a[i] == 0 and b[i] == 0:
output[i] = 0
elif a[i] == 1 and b[i] == 0:
output[i] = 1
elif a[i] == 0 and b[i] == 1:
output[i] = 2
elif a[i] == 1 and b[i] == 1:
output[i] = 3
expected_output = np.array([0,1,2,3])
what is the fastest way of creating such array?