I have a numpy array like this:
letters = np.array([A, B, C, A, B, C, A, B, C])
I'm trying to return another array containing all the indexes of certain items in the array above. I have tried:
letter_indexes = np.where(np.any(letters == 'A', letters == 'C'))
So if letter is either A or C, index should be stored in array letter_indexes
Output should be:
0, 2, 3, 5, 6, 8
But it's not, I'm getting an error: TypeError: only integer scalar arrays can be converted to a scalar index
Could I have some advise?