[SciPy-user] Array handling

Robert Cimrman cimrman3 at ntc.zcu.cz
Fri Oct 21 05:54:49 CDT 2005


Nils Wagner wrote:
>>>>a=rand(4)
>>>>a
> 
> array([ 0.53451766,  0.10459875,  0.91114967,  0.70552477])
> 
> How can I chop the components of the array a to m decimal places (e.g.
> m=2 --> a_new = array(([0.53, 0.10, 0.91, 0.70])) ?

scipy.round_( 1.234234234, 2 )

r.



More information about the SciPy-user mailing list