[Numpy-discussion] rank-0 arrays
perry at stsci.edu
Fri Sep 13 13:15:09 CDT 2002
> If we just implemented Python scalars for the other precisions then much
> of this rank 0 array business would be solved as we could always return
> the Python scalar rather than an array for rank 0 arrays.
> I believe Konrad made this suggestion many moons ago and I would agree
> with him.
> -Travis Oliphant
refresh my memory about how this proposal would work. I've heard
proposals to add new types to Python itself, but that seems out of
the question. Are you talking about adding new scalar types as
>>> x = Int8(22)
>>> arr = arange(10, typecode = Int8)
Or some other approach?
In any case, doesn't this still have the problem that Eric complained
about, having to test for whether a result is an array or a scalar
(which was one of the drivers to produce rank-0 results).
More information about the Numpy-discussion