[Numpy-discussion] Reductions and binary ops on recarrays...

Fernando Perez fperez.net@gmail....
Thu Jul 30 13:41:10 CDT 2009


On Thu, Jul 30, 2009 at 7:55 AM, <josef.pktd@gmail.com> wrote:
> Are these functions really for a relevant use case of structured
> arrays. I haven't seen any examples of multidimensional structured
> arrays, but from a quick reading it doesn't seem to handle mixed types
> (raises error) or nested structured arrays (I'm not sure), for which I
> have seen a lot more examples.

In our work, multidimensional record arrays with homogeneous types are
a regular occurrence.  This code was written for *our* problems, not
to be completely general, and it was posted as "if it's useful to you,
feel free to use it".  I don't have the time/bandwidth to work on this
idea for core numpy inclusion.

Your other comments are all equally valid ideas, and all those would
be necessary considerations for someone who wants to develop something
like this to have full generality.  Other things that would need to be
done:

- Proper support for broadcasting
- mixed binary ops with scalars or normal arrays
- masked array support

Perhaps some enterprising soul will come back later with a robust
implementation of all this...  But I'm afraid that won't be me :)
This discussion could serve as a good starting point of simple code
and points to keep in mind for such a task, so thanks for the
feedback.

Cheers,

f


More information about the NumPy-Discussion mailing list