Skip to content

BUG: validate_percentile error message wrong with negative percentiles #51436

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
jbrockmendel opened this issue Feb 16, 2023 · 5 comments · Fixed by #51475
Closed

BUG: validate_percentile error message wrong with negative percentiles #51436

jbrockmendel opened this issue Feb 16, 2023 · 5 comments · Fixed by #51475
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member

Comments

@jbrockmendel
Copy link
Member

jbrockmendel commented Feb 16, 2023

>>> pd.util._validators.validate_percentile([-1])
ValueError: percentiles should all be in the interval [0, 1]. Try [-0.01] instead.

-0.01 is still invalid. The exception message should trim that suggestion.

@jbrockmendel jbrockmendel added Bug Needs Triage Issue that has not been reviewed by a pandas team member labels Feb 16, 2023
@ShashwatAgrawal20
Copy link
Contributor

take

@ShashwatAgrawal20
Copy link
Contributor

Do the suggestion need to be modified or removed overall ?

@jbrockmendel
Copy link
Member Author

your choice

@ShashwatAgrawal20
Copy link
Contributor

your choice

@jbrockmendel I am confused.

msg = "percentiles should all be in the interval [0, 1]. Try value within this range instead."

what about a message like this ?

@jbrockmendel
Copy link
Member Author

I'd probably just drop the last sentence

@ShashwatAgrawal20 ShashwatAgrawal20 removed their assignment Aug 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Needs Triage Issue that has not been reviewed by a pandas team member
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants