[SciPy-user] output format

Scott Ransom ransom at physics.mcgill.ca
Mon Oct 27 10:02:59 EST 2003


Hi Nils,

On Mon, Oct 27, 2003 at 01:27:30PM +0100, Nils Wagner wrote:
> Dear experts, 
>  
> Is it possible to remove e+xx in the output 
> generated by io.write_array(file,B4,...) 
> Actually, the entries of B4 are integers. 
>  
> >>> B4 
> array([[  4.25424070e+10,   3.81028483e+10,   2.12712035e+10], 
>        [  3.36632897e+10,   3.01503208e+10,   1.68316448e+10], 
>        [  8.87911734e+09,   7.95252750e+09,   4.43955867e+09]]) 

Actually, they are not integers.  They are doubles.  That is
why they have the scientific notation.  They may have started
out as integers, but they were cast to doubles sometime along
the way.  You can prevent casts using the savespace() method of
Numeric arrays.  But note that Numeric uses 32 bit integers and
so many of your values would cause a 32 bit int to overflow...

Scott

-- 
Scott M. Ransom              Address:  McGill Univ. Physics Dept.
Phone:  (514) 398-6492                 3600 University St., Rm 338
email:  ransom at physics.mcgill.ca       Montreal, QC  Canada H3A 2T8 
GPG Fingerprint: 06A9 9553 78BE 16DB 407B  FFCA 9BFA B6FF FFD3 2989



More information about the SciPy-User mailing list