When printing arrays, Numpy replaces trailing 0
s with s, e.g.
[-0.678231 -0.618304 -0.6077 0.014845]
How can I fix this and make it print the 0
s?
When printing arrays, Numpy replaces trailing 0
s with s, e.g.
[-0.678231 -0.618304 -0.6077 0.014845]
How can I fix this and make it print the 0
s?
You can use numpy's set_printoptions
with a custom formatter to set the precision and exact format of the output; for your case,
np.set_printoptions(formatter={'float': '{: 0.3f}'.format})
should do the trick.