[SciPy-user] force to scientific output

Christian Meesters meesters at uni-mainz.de
Mon Oct 17 09:28:24 CDT 2005


Ouch! Stupid me. Sometimes it's better to just leave the lab, hm?

Danke Dir,
Christian

On 17 Oct 2005, at 16:20, Nils Wagner wrote:

> 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)
>
>
>
>
>
> _______________________________________________
> SciPy-user mailing list
> SciPy-user at scipy.net
> http://www.scipy.net/mailman/listinfo/scipy-user
>



More information about the SciPy-user mailing list