[MATRIX-SIG] float -> integer with array?

Timothy A. Hochberg hochberg@wwa.com
Wed, 10 Sep 1997 10:37:23 -0500 (CDT)


On Wed, 10 Sep 1997, Dirk Engelmann wrote:

> Hi!
> 
> Is there a way to convert a float array to
> an integer ?
> (In my case, I just have zeros behind decimal point).

Use the method astype(Int). For example:

>>> a
array([ 1.])
>>> b = a.astype(Int)
>>> b
array([1])

 ____   
  /im  

+------------------------------------------------+
|Tim Hochberg            Research Assistant      |
|hochberg <at> wwa.com   University of Illinois  |
|                        Electrical Engineering  |
+------------------------------------------------+


_______________
MATRIX-SIG  - SIG on Matrix Math for Python

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