The following Python code appears to be very long winded when coming from a Matlab background
>>> a = [1, 2, 3, 1, 2, 3] >>> [index for ind
For me it works well:
>>> import numpy as np >>> a = np.array([1, 2, 3, 1, 2, 3]) >>> np.where(a > 2)[0] [2 5]