[Numpy-discussion] unique1d and asarray

Pierre GM pgmdevlist@gmail....
Sun Jan 4 15:44:33 CST 2009


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,  
the mask is recognized by argsort and the result correct.
Is there a reason why we use np.asarray instead of np.asanyarray ?
Thanks a lot in advance,
P.


More information about the Numpy-discussion mailing list