-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
ENH: Deprecate non-keyword arguments for Resampler.interpolate #41699
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 10 commits
638255f
fc93316
c526864
99ffd77
9f1363f
4990a15
afa41d0
b99fa40
3d8eff7
f6076d2
b47ecc2
c27e606
2954950
3497b5a
7ff25da
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 |
---|---|---|
|
@@ -278,3 +278,30 @@ def test_resample_base_with_timedeltaindex(): | |
|
||
tm.assert_index_equal(without_base.index, exp_without_base) | ||
tm.assert_index_equal(with_base.index, exp_with_base) | ||
|
||
|
||
def test_interpolate_posargs_deprecation(): | ||
# GH 41485 | ||
df = DataFrame({"ds": ["1992-08-27 07:46:48", "1992-08-27 07:46:59"], "y": [1, 4]}) | ||
s = Series( | ||
df.iloc[:, 1].values.reshape(-1), index=pd.to_datetime(df.iloc[:, 0].values) | ||
) | ||
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. Is there a simpler way to create 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 it is needed to give this logic for s, otherwise it is taking the indexes making it not operable 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 you do something like
|
||
|
||
result = s.resample("3s").interpolate("linear") | ||
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. Once you've got the warning message, you need to put the
back 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. But with that it is not able to pass the testcase 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. then you need to fix the code so it passes the testcase 😄 |
||
|
||
df = DataFrame( | ||
{ | ||
"ds": [ | ||
"1992-08-27 07:46:48", | ||
"1992-08-27 07:46:51", | ||
"1992-08-27 07:46:54", | ||
"1992-08-27 07:46:57", | ||
], | ||
"y": [1.0, 1.0, 1.0, 1.0], | ||
} | ||
) | ||
expected = Series( | ||
df.iloc[:, 1].values.reshape(-1), index=pd.to_datetime(df.iloc[:, 0].values) | ||
) | ||
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. construct |
||
expected.index.freq = "3s" | ||
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. @jbrockmendel in other tests I've seen you do
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. the
MarcoGorelli marked this conversation as resolved.
Show resolved
Hide resolved
|
||
tm.assert_series_equal(result, expected) |
Uh oh!
There was an error while loading. Please reload this page.