[MATRIX-SIG] [Q] casting double to char in NumPy1.0b3

Janko Hauser jhauser@ifm.uni-kiel.de
Tue, 2 Dec 1997 15:43:47 +0100 (CET)


Hi, try this, it should work :0)

>>> a=arange(10,typecode=Float32)
>>> a
array([ 0.,  1.,  2.,  3.,  4.,  5.,  6.,  7.,  8.,  9.],'f')
>>> a.astype(Int8)
array([0, 1, 2, 3, 4, 5, 6, 7, 8, 9],'1')
>>> 

Now, we are eager to see the new great NumPy application :-)

__Janko, only speaking for himself.




_______________
MATRIX-SIG  - SIG on Matrix Math for Python

send messages to: matrix-sig@python.org
administrivia to: matrix-sig-request@python.org
_______________