> I have a numpy record array and I want to pretty print a single
> element. I was trying to loop over the names in the element dtype and
> use getattr to access the field value, but I got fouled up because
> getattr is trying to access the dtype attribute of one of the python
> objects (datetime.date) that I am storing in the record array. The
> problem field in the example below is ('fiscaldate', '|O4') which is a
> python datetime.date object.
>
I don't really know much about record arrays since I haven't used them at all
really... but are you perhaps trying to emulate a time series with your record
arrays? You may want to take a look at the timeseries module that is currently
in development: http://www.scipy.org/TimeSeriesPackage . It can probably ease
your pain in terms of dealing with date indexing in a more seamless manner, as
well as "pretty printing" (and plotting). There is also a sub-module in the
package for record array TimeSeries objects of sorts... but Pierre would be more
qualified to talk about that than me.
We LOVE getting new testers and feedback, so if you're willing to give it a spin
it would be greatly appreciated.
- Matt
_______________________________________________
Numpy-discussion mailing list
[email protected]
http://projects.scipy.org/mailman/listinfo/numpy-discussion