[SciPy-user] scipy.io.write_array and the precision

Ryan Krauss ryanlists at gmail.com
Thu Apr 6 09:49:44 CDT 2006


That seems like a decent solution.  Should the code be patched to
replace precision with fmtstr="%0.5e" so that users can pass in a more
general formatting string?  Or add fmtstr=None and use it if it is
given and  fmtstr = "%%.%de" % precision if fmtstr is None.

Ryan

On 4/6/06, jaonary at free.fr <jaonary at free.fr> wrote:
> I had a look into the io.array_import.py and did the following modification :
>
>
> def str_array(arr, precision=5,col_sep=' ',row_sep="\n",ss=0):
>
>   --> added
>     if precision > -1 :
>         fmtstr = "%%.%de" % precision
>     else :
>         fmtstr = "%f"
>
> And now I have what I need when I use io.write_array(file,array,precision=-1)
>
> Jaonary
>
> _______________________________________________
> 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