python - numpy.set_printoption not working with pandas dataframe -
i using jupterlab 0.18.1. , try learn pandas. created dataframe , applied ufuncs numpy. applied numpy.set_printoptions, precision = 4 , suppress =ture, after that, not getting desired result in printing.
rng = np.random.randomstate(42) df = pd.dataframe(rng.randint(0, 10, (3, 4)), columns=['a', 'b', 'c', 'd']) np.set_printoptions(precision=4,suppress=true) data = np.sin(df * np.pi / 4) print(data)
output
b c d 0 -1.000000 7.071068e-01 1.000000 -1.000000e+00 1 -0.707107 1.224647e-16 0.707107 -7.071068e-01 2 -0.707107 1.000000e+00 -0.707107 1.224647e-16
what else missed? please help
there printing options pandas.
pd.set_option('precision', 4)
Comments
Post a Comment