Notebook
# Not to be executed result = [] for i in range(n): if cond1[i] and cond2[i]: result.append(0) elif cond1[i]: result.append(1) elif cond2[i]: result.append(2) else: result.append(3)# Not to be executed np.where(cond1 & cond2, 0, np.where(cond1, 1, np.where(cond2, 2, 3)))# Not to be executed result = 1 * cond1 + 2 * cond2 + 3 * -(cond1 | cond2)
!cat array_ex.txtarr23 = np.loadtxt('array_ex.txt', delimiter = ',') arr23