-
-
Notifications
You must be signed in to change notification settings - Fork 18.4k
DEPR: dropping nuisance columns in rolling aggregations #42834
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
Changes from all commits
121e2df
0c8f332
eb52049
ff82b73
083d21b
4bcbd40
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
|
@@ -116,8 +116,10 @@ def test_ewma_with_times_equal_spacing(halflife_with_times, times, min_periods): | |||
data = np.arange(10.0) | ||||
data[::2] = np.nan | ||||
df = DataFrame({"A": data, "time_col": date_range("2000", freq="D", periods=10)}) | ||||
result = df.ewm(halflife=halflife, min_periods=min_periods, times=times).mean() | ||||
expected = df.ewm(halflife=1.0, min_periods=min_periods).mean() | ||||
with tm.assert_produces_warning(FutureWarning, match="nuisance columns"): | ||||
# GH#42738 | ||||
result = df.ewm(halflife=halflife, min_periods=min_periods, times=times).mean() | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also should probably add a deprecation here too that allows times to be a string of a column label (which is already kinda flawed because a column label isn't always a string). A column of times will always be a nuisance column I think pandas/pandas/core/window/ewm.py Line 317 in a5f8c9a
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can this be done separately? this is less obvious to me There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think so, yes. |
||||
expected = df.ewm(halflife=1.0, min_periods=min_periods).mean() | ||||
tm.assert_frame_equal(result, expected) | ||||
|
||||
|
||||
|
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 list the columns that are problematic in the error message?
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.
updated + green