Re: [Numpy-discussion] Alternative to boolean array

2011-07-20 Thread Brett Olsen
On Tue, Jul 19, 2011 at 11:08 AM, Robert Kern robert.k...@gmail.com wrote: On Tue, Jul 19, 2011 at 07:38, Andrea Cimatoribus g.plantagen...@gmail.com 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

[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

Re: [Numpy-discussion] Alternative to boolean array

2011-07-19 Thread Robert Kern
On Tue, Jul 19, 2011 at 07:38, Andrea Cimatoribus g.plantagen...@gmail.com 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