MatPy question

Uwe Schmitt uwe at
Tue Nov 20 11:52:57 CET 2001

Huaiyu Zhu <huaiyu at> wrote:
| On 19 Nov 2001 15:31:13 GMT, Uwe Schmitt <uwe at> 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. :-)

I'd prefer indexing from zero, because it's the notion used in
mathematics, most existing algorithms are formulated this way.

Greetings, Uwe.

Dr. rer. nat. Uwe Schmitt                       Uwe.Schmitt at
Universitaet des Saarlandes                     Angewandte Mathematik
Building 36.1 Room 4.17         PO-Box 151150   D-66041 Saarbruecken
Mobile:0177/6806587    Fax:+49(0)681/302-4435   Office:+49(0)681/302-2468

More information about the Python-list mailing list