[Numpy-discussion] rank-0 arrays

Konrad Hinsen hinsen at cnrs-orleans.fr
Fri Sep 13 08:40:06 EDT 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.
-- 
-------------------------------------------------------------------------------
Konrad Hinsen                            | E-Mail: hinsen at cnrs-orleans.fr
Centre de Biophysique Moleculaire (CNRS) | Tel.: +33-2.38.25.56.24
Rue Charles Sadron                       | Fax:  +33-2.38.63.15.17
45071 Orleans Cedex 2                    | Deutsch/Esperanto/English/
France                                   | Nederlands/Francais
-------------------------------------------------------------------------------




More information about the NumPy-Discussion mailing list