-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
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
Conversation
Hello @ShamithaReddy! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:
Comment last updated at 2022-03-19 08:18:40 UTC |
There was a problem hiding this 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)
doc/source/whatsnew/v1.4.2.rst
Outdated
@@ -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`) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
move to 1.5
1392115
to
693a4b8
Compare
There was a problem hiding this 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`) | |||
- | |||
|
There was a problem hiding this comment.
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]) |
There was a problem hiding this comment.
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`) |
There was a problem hiding this comment.
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.
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. |
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. |
DataFrame.describe(percentiles=[0.29, 0.57, 0.58])
are incorrect #46362doc/source/whatsnew/v1.4.2.rst