Per the docs I set the number of digits of precision for printing a numpy float to 8 and expected to see
1.12345679 from this code but did not:
import numpy as np
np.set_printoptions(precision=8)
x = np.float_(1.123456789)
print x
Per the docs I set the number of digits of precision for printing a numpy float to 8 and expected to see
1.12345679 from this code but did not:
import numpy as np
np.set_printoptions(precision=8)
x = np.float_(1.123456789)
print x
 
    
    As the comments have suggested you could use numpy.around.
import numpy as np
np.set_printoptions(precision=4)
x = np.float_(1.123456789)
print x
x = np.around(x, 8)
print x
This outputs:
1.123456789
1.12345679
