[SciPy-user] force to scientific output

Nils Wagner nwagner at mecha.uni-stuttgart.de
Mon Oct 17 09:20:21 CDT 2005


Christian Meesters wrote:
>Hi
>
>This is totally off-topic, but I guess chances are that some of you 
>know an answer.
>I need to write an output file for a command line tool which requires a 
>column of floats - in so called scientific notation (4.23e-2 instead of 
>0.0423). Is there a way to dump numbers like this to a file?
>
>TIA
>Christian
>
>_______________________________________________
>SciPy-user mailing list
>SciPy-user at scipy.net
>http://www.scipy.net/mailman/listinfo/scipy-user
>  
from scipy import *
a = rand(10)
file=open('dump','w')
io.write_array(file,a,precision=2)


 




More information about the SciPy-user mailing list