[Numpy-discussion] rank-0 arrays

Todd Miller jmiller at stsci.edu
Fri Sep 13 08:23:09 CDT 2002


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

2.  What's a decent notation for .asScalar()?

a.  a[ <subscript_resulting_in_rank0> ][0]                (what numarray 
does now)
b.  a[ <subscript_resulting_in_rank0> ]()                  (override 
__call__)
c.  a[ <subscript_resulting_in_rank0> ].asScalar()  

Any strong opinions?

Todd

-- 
Todd Miller 			jmiller at stsci.edu
STSCI / SSG







More information about the Numpy-discussion mailing list