Using vstack to stack arrays on python but the floats change to scientific notation

280 views Asked by At

I have a few nice arrays of floats that end with .0, and I would like to merge them together. However, when I do so using numpy vstack, it adds 0s to the end of the floating number, causing it to be written in scientific notation.

 [ 24.   5.]
 [  8.   5.]
 [ 18.   0.]
 [  0.   5.]
 [  9.   1.]
 ...

becomes

 [  2.40000000e+01   5.00000000e+00]
 [  8.00000000e+00   5.00000000e+00]
 [  1.80000000e+01   0.00000000e+00]
 [  0.00000000e+00   5.00000000e+00]
 [  9.00000000e+00   1.00000000e+00]
 ...

my code:

merged = np.vstack((twocol, merged))

I am essentially stacking more arrays into a bigger array called merged. Does anyone know any solution?

0

There are 0 answers