Hi, is there a good method to find the index of the first element in a 1D array fulfilling a condition?
The following does the job >>> import numpy >>> a = numpy.array([1,5,78,3,12,4]) >>> numpy.where( a>10 )[0][0] 2 but it first compares the entire array and then selects the first index. Is there a way (especially for big arrays) to stop the comparison after the first hit? Thanks for any help, Johann _______________________________________________ NumPy-Discussion mailing list [email protected] http://mail.scipy.org/mailman/listinfo/numpy-discussion
