Python Forum

Full Version: Numpy savetxt, how save number with decimal separator
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I generated a Array with
x = numpy.zeros((2,2))
and assigned one "index" with a value =
x[0,1] = 5.25
I would like to export easily this as an CSV. I used
numpy.savetxt('exported.csv',x.ravel(),delimiter=',')
But this store the data as float:
5.349999999999999645e+00

How could I have the data formatted as such ?

Quote:0
5.25
0