Skip to content

Fix strange behavior when precision display option is zero (#20359) #35212

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

Merged
merged 6 commits into from
Jul 10, 2020
Merged

Fix strange behavior when precision display option is zero (#20359) #35212

merged 6 commits into from
Jul 10, 2020

Conversation

gimseng
Copy link
Contributor

@gimseng gimseng commented Jul 10, 2020

Notes:

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good.. can you add a whatsnew note, in 1.1 Bug fixes, in the I/O section. ping when green.

@jreback jreback added Output-Formatting __repr__ of pandas objects, to_string Bug labels Jul 10, 2020
@jreback jreback added this to the 1.1 milestone Jul 10, 2020
@@ -2910,6 +2910,15 @@ def test_format(self):
assert result[0] == " 12.0"
assert result[1] == " 0.0"

def test_output_display_precision_trailing_zeroes(self):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can you also test with the 2 as display.precision (ideally parameterize), but ok to just list a 2nd case if easier

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jreback i actually didn’t have time to address the second test but I saw that you merged the PR ald. I assume that means the test is fine. Let me know otherwise.

@gimseng
Copy link
Contributor Author

gimseng commented Jul 10, 2020

@jreback Thanks for the comments and suggestions. I'll incorporate them soon.

Copy link
Contributor

@jreback jreback left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm. ping when green

@jreback jreback merged commit f0a7d18 into pandas-dev:master Jul 10, 2020
@jreback
Copy link
Contributor

jreback commented Jul 10, 2020

thanks @gimseng

@gimseng gimseng deleted the fixprecisiondisplay branch July 17, 2020 09:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Output-Formatting __repr__ of pandas objects, to_string
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Strange behaviour of the precision display option
2 participants