I have built a recarray with np.rec.fromarrays
and following structure :
dtype=np.dtype([('layers', 'U256'), ('hours', datetime.datetime), ('points', 'U256')]))
I get an object like this :
[('image1.jpg', datetime.datetime(1900, 1, 1, 21, 20), 'mypoints.points')
('image2.jpg', datetime.datetime(1900, 1, 1, 21, 15), 'mypoints.points')]
with recarray
type. I want to sort my recarray based on the second column containing datetime
. I tried numpy.recarray.sort
but it returns a NoneType object. I use it like this :
mytable.sort(order='hours')
I also tried to pass kind='quicksort'
to the function but doesn't understand its usefulness.