[Numpy-discussion] PEP: named axis

Stéfan van der Walt stefan@sun.ac...
Fri Feb 6 03:22:20 CST 2009

Hi Robert

2009/2/6 Robert Kern <robert.kern@gmail.com>:
>> This could be implemented but would require adding information to the
>> NumPy array.
> More than that, though. Every function and method that takes an axis
> or reduces an axis will need to be rewritten. For that reason, I'm -1
> on the proposal.

Are you -1 on the array dictionary, or on using it to do axis mapping?
 I would imagine that Gael would be happier even if he had to do

axis = x.meta.axis['Lateral']
some_func(x, axis)

> I'm of the opinion that it should never guess. We have no idea what
> semantics are being placed on the dict. Even in the case where all of
> the inputs have the same dict, the operation may easily invalidate the
> metadata. For example, a reduction on one of these axis-decorated
> arrays would make the axis labels incorrect.

That's a good point.  So what would be a sane way of propagating
meta-data?  If we don't want to make any assumptions, it becomes the
user's responsibility to do it manually.


More information about the Numpy-discussion mailing list