[Numpy-discussion] MATLAB to Numpy

Andrei Berceanu berceanu at runbox.com
Mon Oct 23 09:05:26 EDT 2017


Thank you so much, the solution was much simpler than I expected!

On Sat, 21 Oct 2017 23:04:43 +0200, Daπid <davidmenhur at gmail.com> wrote:

> On 21 October 2017 at 22:32, Eric Wieser <wieser.eric+numpy at gmail.com>
> wrote:
> 
> > David, that doesn’t work, because np.cumsum(mask)[mask] is always equal
> > to np.arange(mask.sum()) + 1. Robert’s answer is correct.
> >
> Of course, you are right. It makes sense in my head now.
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at python.org
> https://mail.python.org/mailman/listinfo/numpy-discussion




More information about the NumPy-Discussion mailing list