Skip to content

Added the round( ) function to avoid error while multiplication of float numbers issue: #46362 #46388

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

Closed
wants to merge 4 commits into from

Conversation

ShamithaReddy
Copy link

@pep8speaks
Copy link

pep8speaks commented Mar 16, 2022

Hello @ShamithaReddy! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

Line 3266:43: E231 missing whitespace after ','
Line 3266:48: E231 missing whitespace after ','
Line 3266:53: E231 missing whitespace after ','

Comment last updated at 2022-03-19 08:18:40 UTC

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.

needs a test to replicate the original issue (the describe case)

@@ -30,7 +30,7 @@ Bug fixes
~~~~~~~~~
- Fix some cases for subclasses that define their ``_constructor`` properties as general callables (:issue:`46018`)
- Fixed "longtable" formatting in :meth:`.Styler.to_latex` when ``column_format`` is given in extended format (:issue:`46037`)
-
- Fixed a case where the format of printing percentiles in not correct for the describe function in ``format.py`` (:issue:`46362`)
Copy link
Contributor

Choose a reason for hiding this comment

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

move to 1.5

@ShamithaReddy
Copy link
Author

needs a test to replicate the original issue (the describe case)
@jreback
I did already include the original test case in 998f917

@ShamithaReddy ShamithaReddy force-pushed the describe_branch branch 2 times, most recently from 1392115 to 693a4b8 Compare March 19, 2022 08:18
Copy link
Member

@datapythonista datapythonista left a comment

Choose a reason for hiding this comment

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

Thanks for the contribution @ShamithaReddy. Implementation looks good. Added some comments. I think they should also leave the CI green, but would be great if you can check it yourself, and fix any other problem that make it red.

You've also got a conflict that you need to fix.

@@ -30,7 +30,7 @@ Bug fixes
~~~~~~~~~
- Fix some cases for subclasses that define their ``_constructor`` properties as general callables (:issue:`46018`)
- Fixed "longtable" formatting in :meth:`.Styler.to_latex` when ``column_format`` is given in extended format (:issue:`46037`)
-

Copy link
Member

Choose a reason for hiding this comment

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

Can you revert this please?

@@ -3262,6 +3262,11 @@ def test_format_percentiles():
expected = ["0%", "50%", "2.0%", "50%", "66.67%", "99.99%"]
assert result == expected

# Issue #46362
result = fmt.format_percentiles([0.281,0.57,0.58,0.29])
Copy link
Member

Choose a reason for hiding this comment

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

You need spaces after the commas. Also, those are supposed to be percentiles, so they should be sorted.

@@ -362,6 +362,7 @@ Conversion
- Bug in :meth:`Series.astype` and :meth:`DataFrame.astype` from floating dtype to unsigned integer dtype failing to raise in the presence of negative values (:issue:`45151`)
- Bug in :func:`array` with ``FloatingDtype`` and values containing float-castable strings incorrectly raising (:issue:`45424`)
- Bug when comparing string and datetime64ns objects causing ``OverflowError`` exception. (:issue:`45506`)
- Bug in :meth:`format.py` the percentiles values are converted to integer dtype, which ignores the floating point error while multiplying. (:issue:`46362`)
Copy link
Member

Choose a reason for hiding this comment

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

This seems a bit confusing. What about something more like "Bug when formatting percentiles, more decimals than needed shown" or something similar.

@datapythonista datapythonista added Bug Output-Formatting __repr__ of pandas objects, to_string labels Apr 5, 2022
@github-actions
Copy link
Contributor

github-actions bot commented May 6, 2022

This pull request is stale because it has been open for thirty days with no activity. Please update and respond to this comment if you're still interested in working on this.

@github-actions github-actions bot added the Stale label May 6, 2022
@mroeschke
Copy link
Member

Thanks for the pull request, but it appears to be stale. If interested in continuing, please merge in the main branch, address the review, and we can reopen.

@mroeschke mroeschke closed this May 24, 2022
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 Stale
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: The indexes of DataFrame.describe(percentiles=[0.29, 0.57, 0.58]) are incorrect
5 participants