I'm trying to get rid of this format to make this file readable in another software.
import numpy as np
test=[5.1056e+02, 6.89752e+05, 4.5987126464655e+03]
np.round(test,6)
print(test)
test2=[[5.1056e+02, 6.89752e+05, 4.5987126464655e+03],[5.1056e+02, 6.89752e+05, 4.5987126464655e+03]]
test2=np.array(test2)
np.round(test2,6)
print(test2)
1st print gives me :
[510.56, 689752.0, 4598.7126464655]
2nd print gives me :
[[ 5.10560000e+02 6.89752000e+05 4.59871265e+03]
[ 5.10560000e+02 6.89752000e+05 4.59871265e+03]]
Now the first result would be fine by me, but my data looks like test2. But I still don't understand what the second argument of np.round does, as it is supposed to limit the number of decimals, but I still get 4598.7126464655. But at least I'd get a usable format.
How can I make this work on something like test2 ? I tried this :
for i in range(np.shape(test2)[0]):
np.round(test2[i])
print(test2)
Still gives me :
[[ 5.10560000e+02 6.89752000e+05 4.59871265e+03]
[ 5.10560000e+02 6.89752000e+05 4.59871265e+03]]