[PYTHON MATRIX-SIG] Re: Pseudo Indices
Hinsen Konrad
hinsenk@ere.umontreal.ca
Tue, 30 Jan 1996 14:21:11 -0500
In order to make such code easier to read, Yorick introduces the
notion of a pseudo index that can be added to any multidimensional index
and means, add a new dimension here.
ie. b[2, PseudoIndex] <--> b.reshape(2, 1)
Not quite. "2" means "the third element".
"All" is not in fact related to Yorick pseudo indices at all, but is
related to Slices.
But "All" is the equivalent of the Yorick pseudoindex *, which of
course is also a special form of a slice.
c = array([[1,2,3], [11,12,13]])
I'd really like to be able to say c[:, 3] -> array([3,13]). Python
Small correction: c[:, 2].
In Yorick that would look like a[.., 3]. Since Python doesn't yet
have this rubber index, I use the following:
a[RubberIndex, 3].
That should also get a better name... I think I already made
some proposals, I just have to dig that message out again...
-------------------------------------------------------------------------------
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. Centre-Ville | 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
=================