Re: [Numpy-discussion] pretty printing record array element - datetime

2007-05-15 Thread Travis Oliphant
John Hunter wrote: > 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 >

Re: [Numpy-discussion] pretty printing record array element - datetime

2007-05-15 Thread Pierre GM
In addition to Matt's answer: Yes, we have a tmulti where you can store dates and other variables in a record-like TimeSeries. However, there must be simpler: Why are you using getattr to access the fields ? Your object tr is a record array, so you could use for n in tr.dtype.names: print n,

Re: [Numpy-discussion] pretty printing record array element - datetime

2007-05-15 Thread Matt Knox
> 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.

[Numpy-discussion] pretty printing record array element - datetime

2007-05-15 Thread John Hunter
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