-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
PERF: Fix quantile perf regression #35101
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
Closes pandas-dev#35049 ```pyhon 591 µs ± 29.5 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) 440 µs ± 22.8 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each) ```
pandas/util/_validators.py
Outdated
) | ||
# Don't change this to an f-string. The string formatting | ||
# is too expensive for cases where we don't need it. | ||
msg = "percentiles should all be in the interval [0, 1]." "Try {} instead." |
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.
extra quotation marks probably an artifact of black
Should we take a more general look at where we can/should do string formatting more lazily? |
Interesting - so the evaluation of q / 100 makes things slower right? I would have thought generally f-strings would be more performant given things like this: https://stackoverflow.com/questions/43123408/f-strings-in-python-3-6 But I suppose that assumes that the expression needs to be evaluated, which isn't the case here unless an exception occurs |
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.
lgtm when green
Thanks @TomAugspurger |
Closes #35049