[Tutor] selecting attributes of all elements in numpy arrays

R. Santos chudxx at gmail.com
Sun Dec 7 22:14:14 CET 2008


I have a numpy recarray (rd) with a datetime  field (bar_dt) and I
want to filter the recarray by year.  So far, the only way I've been
able to do this is by using
rd[np.array([i.year for i in rd.bar_dt])==2008].

Is there a better way to do this?  It seems like I must be overlooking
something.

Thanks for any help.


More information about the Tutor mailing list