Re: [Numpy-discussion] rank-0 arrays
by Konrad Hinsen other posts by this author
Sep 16 2002 7:17PM messages near this date
Re: [Numpy-discussion] rank-0 arrays
|
RE: [Numpy-discussion] rank-0 arrays
"Chris Barker" <Chris.Barker@[...].gov> writes:
> Travis Oliphant wrote:
>
> > This is the gist of it. Basically you extend the Python scalars to
> > include the single precision types (all the types Numeric supports).
>
> Would they be recognised as scalars by Python? In particular, could you
There is no "scalar" category in Python. New scalar datatypes would be
types with the same behaviour as the existing Python scalar types, but
different from the. That means that explicitly type-checking code would
not accept them, but everything else would.
> use one as an index? Personally, this is what has bit me in the past: I
At least up to Python 1.5, no, indices have to be of integer type. I
don't know if that condition was extended in later versions.
> could use A[3,2] as an index if A was type "Int" but not if it was
> "Int16" for example.
Ehmmm... Are you sure that is the right example? The restriction is on
the type of the index, not on the type of the array.
> Frankly, I have no idea what the implimentation details would be, but
> could we get rid of rank-0 arrays altogether? I have always simply found
If we introduce additional scalars, yes. Whether or not we would want
to get rid of them is of course another question.
Konrad.
--
-------------------------------------------------------------------------------
Konrad Hinsen | E-Mail: hinsen@[...].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
-------------------------------------------------------------------------------
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Numpy-discussion mailing list
Numpy-discussion@[...].net
https://lists.sourceforge.net/lists/listinfo/numpy-discussion
Thread:
Perry Greenfield
Travis Oliphant
Pearu Peterson
Konrad Hinsen
Perry Greenfield
Todd Miller
Pearu Peterson
Konrad Hinsen
Travis Oliphant
Konrad Hinsen
Perry Greenfield
Travis Oliphant
Tim Hochberg
Chris Barker
Konrad Hinsen
Perry Greenfield
Travis Oliphant
Pearu Peterson
Tim Hochberg
Perry Greenfield
Konrad Hinsen
Perry Greenfield
eric jones
Konrad Hinsen
eric jones
Konrad Hinsen
Tim Hochberg
Tim Hochberg
Paul F Dubois
Scott Gilbert
Konrad Hinsen
|