-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
Pandas style.set_precision not working as expected #13257
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
good first issue
IO HTML
read_html, to_html, Styler.apply, Styler.applymap
Output-Formatting
__repr__ of pandas objects, to_string
Milestone
Comments
I believe this is just reusing something like this from python >>> '{:.2g}'.format(2.37419)
'2.4' Would take a PR fixing this to have the 2.37 like expected. I think we recently fixed a similar problem with the 'display.precision' option. |
4 tasks
df = pd.DataFrame([123.4567, 234.5678, 345.6789, 456.7890],
|
AntonioAndraues
pushed a commit
to AntonioAndraues/pandas
that referenced
this issue
Aug 15, 2019
5 tasks
AntonioAndraues
pushed a commit
to AntonioAndraues/pandas
that referenced
this issue
Aug 19, 2019
BUG: set_precision format fixed (pandas-dev#13257)
AntonioAndraues
pushed a commit
to AntonioAndraues/pandas
that referenced
this issue
Aug 19, 2019
BUG: set_precision format fixed (pandas-dev#13257) fix
AntonioAndraues
pushed a commit
to AntonioAndraues/pandas
that referenced
this issue
Aug 19, 2019
BUG: set_precision format fixed (pandas-dev#13257) fix fix pep8
AntonioAndraues
pushed a commit
to AntonioAndraues/pandas
that referenced
this issue
Aug 19, 2019
BUG: set_precision format fixed (pandas-dev#13257) fix fix pep8 fix pep8
AntonioAndraues
pushed a commit
to AntonioAndraues/pandas
that referenced
this issue
Aug 19, 2019
BUG: set_precision format fixed (pandas-dev#13257) fix fix pep8 fix pep8 black pandas
AntonioAndraues
pushed a commit
to AntonioAndraues/pandas
that referenced
this issue
Aug 20, 2019
BUG: set_precision format fixed (pandas-dev#13257) fix fix pep8 fix pep8 black pandas whatsnew
AntonioAndraues
pushed a commit
to AntonioAndraues/pandas
that referenced
this issue
Aug 20, 2019
BUG: set_precision format fixed (pandas-dev#13257) fix fix pep8 fix pep8 black pandas whatsnew fix small
AntonioAndraues
pushed a commit
to AntonioAndraues/pandas
that referenced
this issue
Aug 21, 2019
BUG: set_precision format fixed (pandas-dev#13257) fix fix pep8 fix pep8 black pandas whatsnew fix small fix small
AntonioAndraues
pushed a commit
to AntonioAndraues/pandas
that referenced
this issue
Aug 21, 2019
BUG: set_precision format fixed (pandas-dev#13257) fix fix pep8 fix pep8 black pandas whatsnew fix small fix small fix small
AntonioAndraues
pushed a commit
to AntonioAndraues/pandas
that referenced
this issue
Aug 22, 2019
AntonioAndraues
pushed a commit
to AntonioAndraues/pandas
that referenced
this issue
Aug 23, 2019
Co-Authored-By: Tom Augspurger <[email protected]>
AntonioAndraues
pushed a commit
to AntonioAndraues/pandas
that referenced
this issue
Sep 3, 2019
Co-Authored-By: Tom Augspurger <[email protected]>
AntonioAndraues
pushed a commit
to AntonioAndraues/pandas
that referenced
this issue
Sep 19, 2019
Co-Authored-By: Tom Augspurger <[email protected]> conflit whatsnew
AntonioAndraues
pushed a commit
to AntonioAndraues/pandas
that referenced
this issue
Sep 19, 2019
Co-Authored-By: Tom Augspurger <[email protected]> conflit whatsnew conflit whatsnew
AntonioAndraues
pushed a commit
to AntonioAndraues/pandas
that referenced
this issue
Sep 19, 2019
Co-Authored-By: Tom Augspurger <[email protected]> conflit whatsnew conflit whatsnew testes
AntonioAndraues
pushed a commit
to AntonioAndraues/pandas
that referenced
this issue
Oct 15, 2019
Co-Authored-By: Tom Augspurger <[email protected]>
WillAyd
pushed a commit
that referenced
this issue
Oct 22, 2019
HawkinsBA
pushed a commit
to HawkinsBA/pandas
that referenced
this issue
Oct 29, 2019
Reksbril
pushed a commit
to Reksbril/pandas
that referenced
this issue
Nov 18, 2019
proost
pushed a commit
to proost/pandas
that referenced
this issue
Dec 19, 2019
proost
pushed a commit
to proost/pandas
that referenced
this issue
Dec 19, 2019
bongolegend
pushed a commit
to bongolegend/pandas
that referenced
this issue
Jan 1, 2020
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
good first issue
IO HTML
read_html, to_html, Styler.apply, Styler.applymap
Output-Formatting
__repr__ of pandas objects, to_string
I expected the following code to give me a representation of my data that is rounded or truncated to 2 decimals.
However, it will always return 2 digits instead, so for example, I want 2.37419 to be displayed as 2.37, but instead this code will give me 2.4. Am I overseeing something or is this a bug?
Note that the following code works as I expected, but then I change a general setting whereas I would like to apply it only to the current output:
I'm using pandas version 0.18.1 in Jupyter notebook on Firefox, with python 2.7.11.final.0 and IPython 4.1.2 on 64-bits linux.
The text was updated successfully, but these errors were encountered: