[Numpy-discussion] rank-0 arrays

Konrad Hinsen hinsen at cnrs-orleans.fr
Fri Sep 13 08:40:06 CDT 2002

Todd Miller <jmiller at stsci.edu> writes:

> Two other issues come up trying to implement the "rank-0 experiment":
> 1.  What should be the behavior of subscripting a rank-0 array?
> a.  Return the scalar value                         (what numarray
> does now.  seems inconsistent)
> b.  Raise an exception
> c.  Return a copy  of the rank-0 array

I am for b). A rank-0 array is not a sequence and has no elements,
so indexing shouldn't be allowed.

Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-
Rue Charles Sadron                       | Fax:  +33-
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais

More information about the Numpy-discussion mailing list