Having trouble manipulating a 2D numpy array (below). I'm using np.where to add a value if the given condition is met, but doesn't seem to be working. Is this simply not possible or am I making a simple mistake?
a = ['circle','square']b=['north','south']c=['red','blue']d=['long','short']x = []for shape in a: for direction in b: for color in c: for length in d: x.append([shape, direction, color, length, 0])x = np.array(x)# conditional add - if condition is met, add 1 to numeric index, else assign value of 2x[:,4] = np.where((x[:,0]=='circle') & (x[:,1]=='south'), x[:,4]+1, 2)