[Numpy-discussion] Type specific sorts: objects, structured arrays, and all that.

Travis Oliphant travis at continuum.io
Tue Jul 10 03:05:49 EDT 2012


On Jul 9, 2012, at 10:32 PM, Charles R Harris wrote:

> Hi All,
> 
> I've been adding type specific sorts for object and structured arrays. It seems that datetime64 and timedelta64 are also not supported. Is there any reason why those types should not be sorted as int64?
> 
> Also, when sorting object arrays, what should be done with NULL pointers to objects? I'm tempted to treat them as nans and sort them to the end. OTOH, perhaps an error should be raised.

My understanding is that people using missing data for object arrays will use the "None" object.  I don't think it's appropriate to ever have NULL pointers for OBJECT arrays except during initialization. 

For example, empty([10,5], dtype=object) produces an array of "None".   What are you planning to do with None's?  You could treat them as nans, I would think. 

-Travis



> 
> Chuck
> _______________________________________________
> NumPy-Discussion mailing list
> NumPy-Discussion at scipy.org
> http://mail.scipy.org/mailman/listinfo/numpy-discussion




More information about the NumPy-Discussion mailing list