[Numpy-discussion] Bug in numarray.typecode()?
Philip Austin
paustin at eos.ubc.ca
Sat Jul 3 10:11:03 EDT 2004
I'm in the process of switching to numarray, but I still
need typecode(). I notice that, although it's discouraged,
the typecode ids have been extended to all new numarray
types described in table 4.1 (p. 19) of the manual, except UInt64.
That is, the following script:
import numarray as Na
print "Numarray version: ",Na.__version__
print Na.array([1],'Int8').typecode()
print Na.array([1],'UInt8').typecode()
print Na.array([1],'Int16').typecode()
print Na.array([1],'UInt16').typecode()
print Na.array([1],'Int32').typecode()
print Na.array([1],'UInt32').typecode()
print Na.array([1],'Float32').typecode()
print Na.array([1],'Float64').typecode()
print Na.array([1],'Complex32').typecode()
print Na.array([1],'Complex64').typecode()
print Na.array([1],'Bool').typecode()
print Na.array([1],'UInt64').typecode()
prints:
Numarray version: 1.0
1
b
s
w
l
u
f
d
F
D
1
Traceback (most recent call last):
File "<stdin>", line 14, in ?
File "/usr/lib/python2.3/site-packages/numarray/numarraycore.py", line 1092, in typecode
return _nt.typecode[self._type]
KeyError: UInt64
Should this print 'U'?
Regards, Phil Austin
More information about the NumPy-Discussion
mailing list