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

josef.pktd at gmail.com josef.pktd at gmail.com
Thu Jul 30 14:56:58 EDT 2009


On Thu, Jul 30, 2009 at 2:41 PM, Fernando Perez<fperez.net at gmail.com> wrote:
> On Thu, Jul 30, 2009 at 7:55 AM, <josef.pktd at 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

Thanks for the example.
I tried to read through the code of the different recarray utility
functions to see how you actually use structured arrays for data
analysis, instead of just as a storage dictionary. Code examples are
the most useful documentation that I have found for this.

Josef



More information about the NumPy-Discussion mailing list