[Numpy-discussion] unique1d and asarray

2009-01-04 Thread Pierre GM
All, Currently, np.unique1d uses np.asarray to ensure the input is an array. The problem is that np.asarray transforms a MaskedArray into a regular ndarray, the missing information is lost and the result is not correct. If we used np.asanyarray instead, subclasses are recognized properly, t

Re: [Numpy-discussion] unique1d and asarray

2009-01-04 Thread Robert Kern
On Sun, Jan 4, 2009 at 15:44, Pierre GM wrote: > All, > Currently, np.unique1d uses np.asarray to ensure the input is an > array. The problem is that np.asarray transforms a MaskedArray into a > regular ndarray, the missing information is lost and the result is not > correct. > If we used np.asany

Re: [Numpy-discussion] unique1d and asarray

2009-01-04 Thread Pierre GM
On Jan 4, 2009, at 4:47 PM, Robert Kern wrote: > On Sun, Jan 4, 2009 at 15:44, Pierre GM wrote: >> >> If we used np.asanyarray instead, subclasses are recognized properly, >> the mask is recognized by argsort and the result correct. >> Is there a reason why we use np.asarray instead of np.asanya

Re: [Numpy-discussion] unique1d and asarray

2009-01-05 Thread Robert Cimrman
Pierre GM wrote: > On Jan 4, 2009, at 4:47 PM, Robert Kern wrote: > >> On Sun, Jan 4, 2009 at 15:44, Pierre GM wrote: >>> If we used np.asanyarray instead, subclasses are recognized properly, >>> the mask is recognized by argsort and the result correct. >>> Is there a reason why we use np.asarray