-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
BUG: Fixed regression in rolling.skew and rolling.kurt modifying object #38909
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
pandas/_libs/window/aggregations.pyx
Outdated
@@ -504,6 +504,7 @@ def roll_skew(ndarray[float64_t] values, ndarray[int64_t] start, | |||
) | |||
output = np.empty(N, dtype=float) | |||
min_val = np.nanmin(values) | |||
values_copy = np.empty(N, dtype=float) |
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.
why don't you simply copy values to begin with? then all of these additions are not needed
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.
Was not sure which would be faster. When we do a copy, we have to touch the values again in case of
min_val - mean_val > -1e5
Changed it
thanks @phofl |
@meeseeksdev backport 1.2.x |
…nd rolling.kurt modifying object
….kurt modifying object (#38945)
black pandas
git diff upstream/master -u -- "*.py" | flake8 --diff
Alternative would be np.copy before releasing gil. In this case we would have to touch values_copy twice in case of
min_val - mean_val > -1e5