Re: [Numpy-discussion] Alternative to boolean array

2011-07-20 Thread Brett Olsen
On Tue, Jul 19, 2011 at 11:08 AM, Robert Kern wrote: > On Tue, Jul 19, 2011 at 07:38, Andrea Cimatoribus > wrote: >> Dear all, >> I would like to avoid the use of a boolean array (mask) in the following >> statement: >> >> mask = (A != 0.) >> B   = A[mask] >> >> in order to be able to move th

Re: [Numpy-discussion] Alternative to boolean array

2011-07-19 Thread Robert Kern
On Tue, Jul 19, 2011 at 07:38, Andrea Cimatoribus wrote: > Dear all, > I would like to avoid the use of a boolean array (mask) in the following > statement: > > mask = (A != 0.) > B   = A[mask] > > in order to be able to move this bit of code in a cython script (boolean > arrays are not yet im

[Numpy-discussion] Alternative to boolean array

2011-07-19 Thread Andrea Cimatoribus
Dear all, I would like to avoid the use of a boolean array (mask) in the following statement: mask = (A != 0.) B = A[mask] in order to be able to move this bit of code in a cython script (boolean arrays are not yet implemented there, and they slow down execution a lot as they can't be defin