Quoting josef.p...@gmail.com: > but the two options don't produce the same result in general, the > cumsum version doesn't restart from zero, I think > > try > x0 = np.random.randint(5,size=30).cumsum() > with delta=3 > > I don't see a way around recursive looping >
The x0 data are already sorted. It was one of the premises of the first post. The solution I proposed makes "almost" what I need and I will most likely use it. It just misses the first value but takes the next one what is fine for my application. For the simple example, it returns [1, 5, 9] instead of [0, 4, 8] but it should not disturb me. Armando _______________________________________________ NumPy-Discussion mailing list NumPy-Discussion@scipy.org http://mail.scipy.org/mailman/listinfo/numpy-discussion