[Numpy-discussion] Tabular data package

Robert Kern robert.kern@gmail....
Mon Oct 5 18:20:35 CDT 2009


On Mon, Oct 5, 2009 at 18:15, Elaine Angelino <elaine.angelino@gmail.com> wrote:

>> Well, what other recarray functionality are you using?
>
> None, in our code.   We also thought that since at least some people like
> using the attribute reference property, perhaps users of tabarrays might too
> (though we don't personally in our own work)   Recarrays still seemed to be
> being supported by NumPy, so it seemed to make sense to use them.   but the
> only functional thing in our code are those constructors.

Then I would suggest making tabarrays subclass from ndarray. If you
like, provide a tabrecarray that subclasses from both recarray and
tabarray so that people who like attribute access can .view() to their
heart's content.

>> > (Also, is first casting to recarrays and then viewing as ndarrays more
>> > expensive than if we went through ndarray directly?)
>>
>
> But if NumPy decided to include ndarray versions of the from*() constructors
> in the distribution, would this be achieved by first using the recarray
> constructor and then viewing as ndarray?  Or would something more "direct"
> be done?

We would fix the functions to not do any unnecessary .view()s.

-- 
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 NumPy-Discussion mailing list