MatPy question

Huaiyu Zhu huaiyu at gauss.almadan.ibm.com
Mon Nov 19 19:43:10 EST 2001


On 19 Nov 2001 15:31:13 GMT, Uwe Schmitt <uwe at rocksport.de> wrote:

>I uses MatPy today and think it' quite useful. But there is one
>incompatibility to matlab: in MatPy indices start at zero, in
>Matlab they start at one. Is there a solution to adapt MatPy to
>the Matlab style ?

Although it is possible with some hacking, I don't think you would want to
do that, because in Python all sequences are indexed this way, including
NumPy arrays.  If that's changed there would be a lot of confusion when you
transform between plain Python and numerical objects.

Besides, there are many good reasons to start indexing from zero.  The open
source Matlab-compatible language Octave allows both indexing from zero and
one.  It defaults to start from zero, but if you choose an option (called
"braindead" or something like that) it can start with one.  Braindead is not
an easy option here. :-)

Huaiyu



More information about the Python-list mailing list