Hmm, so how come this doesn't work now?
mask = ((px > 2.) & ((py**2 + pz**2) / px**2 < 1.))
for arr in (px, py, pz, w, x, y, z):
arr = arr[mask]
On Mon, 23 Oct 2017 15:05:26 +0200 (CEST), "Andrei Berceanu"
<[email protected]> wrote:
> Thank you so much, the solution was much simpler than I expected!
>
> On Sat, 21 Oct 2017 23:04:43 +0200, Daπid <[email protected]> wrote:
>
> > On 21 October 2017 at 22:32, Eric Wieser <[email protected]>
> > 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
> > [email protected]
> > https://mail.python.org/mailman/listinfo/numpy-discussion
>
>
> _______________________________________________
> NumPy-Discussion mailing list
> [email protected]
> https://mail.python.org/mailman/listinfo/numpy-discussion
_______________________________________________
NumPy-Discussion mailing list
[email protected]
https://mail.python.org/mailman/listinfo/numpy-discussion