[PYTHON MATRIX-SIG] Default Axes revisited

Jim Hugunin hugunin@mit.edu
Fri, 30 Aug 1996 17:39:13 -0400


> On Fri, 30 Aug 1996, Jim Hugunin wrote:
> 
> > Structural Operations have a default axis of 0
> > Numeric/Computational Operations have a default axis of -1
> 
> 
> Sounds good to me. I recently understood this and completely agree. Does 
> this mean that all functions that can operate on different axes will have

> an "axis" keyword?

Definately.

> > However, because I don't think it's always obvious what's a structural
and
> > what's a numeric operation, all numeric operations will have a "_"
after
> > their name.
> > 
> > So we have:
> > 
> > take, concatenate, ...
> > argmax_, sort_, argsort_, fft_, ...
> > 
> > I will also probably define functions of the form:
> > 
> > def argmax(x,y=None):
> > 	raise AttributeError, "argmax is a Numeric function, use argmax_"
> 
> But these imposter functions should exactly the same signature as their 
> shadowed brethren. (Just checking - wouldn't there be an "axis" keyword 
> as per the question above?)

argmax takes a single argument.  y=None is my way of handling the default
axis argument.  I will use the word axis there in the real version.

> > Is everybody reasonably happy with this? - Jim
> 
> Reasonably.

If I can get all interested parties to say that I'll be happy.

-Jim

=================
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
=================