numpy np.set_printoptions(precision=3) python 3 code example Example: np print precision np.set_printoptions(precision=4)