Numpy: Set number of decimal places using set_printoptions
> import numpy as np
> np.set_printoptions(precision=4)
> print(np.array([1.123456789]))
[ 1.1235]
> import numpy as np
> np.set_printoptions(precision=4)
> print(np.array([1.123456789]))
[ 1.1235]
Leave a comment