-
-
Notifications
You must be signed in to change notification settings - Fork 18.3k
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
Fixed describe.py #61024
Fixed describe.py #61024
Conversation
Issue-60550-Fixed
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 PR! When changing the behavior of pandas, please always add tests.
pandas/core/methods/describe.py
Outdated
if percentiles == []: | ||
percentiles.append(0.5) # By default, if percentiles is empty then append 50th percentile. |
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.
As mentioned in the linked issue, I think pandas should not be adding in 0.5 when the user specifies percentiles=[]
.
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.
As mentioned in the linked issue, I think pandas should not be adding in 0.5 when the user specifies
percentiles=[]
.
I have removed the automatic addition of 0.5 when percentiles=[], as per the feedback.
Should percentiles=[] return an empty result, or should it raise an error?
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.
percentiles=[]
should produce a result without any percentiles in it. But the result itself will not be empty.
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.
removed the automatic addition of 0.5 when percentiles=[]
…pandas-Abhibhav into issue-60550-fix-v2
bf704ac
to
ee5ff56
Compare
Issue-60550-Fixed
Removed the condition that included 50th percentile. i.e.
if 0.5 not in percentiles :
percentiles.append(0.5)
Added the condition, that 50th percentile should only be appended if the list 'percentiles' is empty.