Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
display.precision not honored for column headers #17280
Code Sample, a copy-pastable example if possible
import pandas as pd import numpy as np pd.options.display.precision = 3 labels = np.random.rand(10) p = pd.DataFrame(np.random.randn(10,10),index=labels,columns=labels) p
The above code works just fine in a standard console, but in a jupyter notebook the float valued column headers are not displayed with a precision of 3. This appears to be due to the notebook_repr_html option, since setting that to False again honors the precision. Note that the same applies to other formatting options, and if I switch to a MultiIndex it looks fine. I posted this as a question on the pydata discussion site and Joris Van den Bossche confirmed that it was an issue and suggested that I report it here.
Yes. I couldn't remember them off the top of my head, but I think that there's a float_format option and an eng_float_format, or something like that. All behave the same way. Thanks, Paul…
Sent from my iPhone On Aug 18, 2017, at 7:01 AM, Joris Van den Bossche <firstname.lastname@example.org<mailto:email@example.com>> wrote: Thanks for reporting! Note that the same applies to other formatting options What do you mean exactly with this? That also other formatting options don't work with the notebook repr? - You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub<#17280 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AEG2KrjA9m1I944PDF6vhXglCny7ADzRks5sZZkQgaJpZM4O7jej>.