[PYTHON MATRIX-SIG] Default axis

Konrad Hinsen hinsen@physik.rwth-aachen.de
Mon, 12 Aug 1996 21:37:25 +0200

   Several people how now brought up the issue of the default axis in the =
   various functions in NumPy. The inconsistency of this definition is =
   really a problem.  I think that it's really important to have a =
   consistent default axis, and I propose that the default axis be made -1 =
   (or -2 for things that expect 2d arrays).  This works fairly well for me =

The matter is really a bit more complicated. Basically, the problem
occurs for arrays whose indices should logically be divided into
two sections: a "superarray" with elements that are subarrays (in J these
are called frames and cells, respectively). There are operations
that act on the superarray, like reduction, and the best default axis
for those is 0. Other operations act on cells (e.g. 1D FFT), and their
default axis should be -1. (In J the first type of function would have
infinite default rank, and the second one would have default rank 1).
The distinction makes sense in practice and I am inclilned to keep it.
Nobody will be happy with a setup in which you almost always have to
specify an axis explicitly due to a bad default value.

Konrad Hinsen                     | E-Mail: hinsenk@ere.umontreal.ca
Departement de Chimie             | Tel.: +1-514-343-6111 ext. 3953
Universite de Montreal            | Fax:  +1-514-343-7586
C.P. 6128, succ. A                | Deutsch/Esperanto/English/Nederlands/
Montreal (QC) H3C 3J7             | Francais (phase experimentale)

MATRIX-SIG  - SIG on Matrix Math for Python

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