[SciPy-user] recarray

Robert Kern robert.kern at gmail.com
Sun Dec 3 18:06:40 CST 2006

Joshua Petterson wrote:
> Hi all,
> I have a little "stupid" question, but what is the purpose of
> recarray? I have saw that numpy.array supports names, then why using
> recarray?

It adds attribute access. E.g.


Note that attribute access goes through a Python method and adds some overhead.
If you happen to be iterating through a large array of records and using
attribute access on each of the individual record objects, that overhead can be
quite substantial. Unfortunately, it appears that record arrays go through the
Python __getattribute__ method even ['name'] access is used (although I haven't
satisfactorally explained to myself why this is the case).

Robert Kern

"I have come to believe that the whole world is an enigma, a harmless enigma
 that is made terrible by our own mad attempt to interpret it as though it had
 an underlying truth."
  -- Umberto Eco

More information about the SciPy-user mailing list