On 22-May-09, at 1:03 PM, Christopher Barker wrote: > In [104]: zip(indices[np.r_[True, breaks[:-1]]], indices[breaks])
I don't think this is very general: In [53]: indices Out[53]: array([ -3, 1, 2, 3, 4, 5, 6, 7, 8, 9, 255, 256, 257, 258, 10001, 10002, 10003, 10004]) In [54]: breaks = diff(indices) != 1 In [55]: zip(indices[np.r_[True, breaks[:-1]]], indices[breaks]) Out[55]: [(-3, -3), (1, 9), (255, 258)] _______________________________________________ Numpy-discussion mailing list Numpy-discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion