-
-
Notifications
You must be signed in to change notification settings - Fork 18.5k
Allow passing other arguments to interpolation functions #10383
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
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 |
---|---|---|
|
@@ -1373,6 +1373,23 @@ def test_spline(self): | |
expected = Series([1., 2., 3., 4., 5., 6., 7.]) | ||
assert_series_equal(result, expected) | ||
|
||
def test_spline_extrapolate(self): | ||
tm.skip_if_no_package('scipy', '0.15', 'setting ext on scipy.interpolate.UnivariateSpline') | ||
s = Series([1, 2, 3, 4, np.nan, 6, np.nan]) | ||
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. any other methods take args? 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 talked about this here: #10383 (comment), I can add 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. ok, why don't you just run it, so will be a smoke test (which asserts that it didn't crash) 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 actually can't get that method to run without the exception I link to in that comment. There seems to be no current test coverage in Pandas of this method. 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. ahh I see. hmm, wonder if that has api changes in recent versions to break this somehow? 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. LMK what you want to do about this. 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 we can leave that for another PR (as there is an issue for this: #10365), if you don't directly know how to solve it 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 have no idea how to solve it :-) |
||
result3 = s.interpolate(method='spline', order=1, ext=3) | ||
expected3 = Series([1., 2., 3., 4., 5., 6., 6.]) | ||
assert_series_equal(result3, expected3) | ||
|
||
result1 = s.interpolate(method='spline', order=1, ext=0) | ||
expected1 = Series([1., 2., 3., 4., 5., 6., 7.]) | ||
assert_series_equal(result1, expected1) | ||
|
||
def test_spline_smooth(self): | ||
tm._skip_if_no_scipy() | ||
s = Series([1, 2, np.nan, 4, 5.1, np.nan, 7]) | ||
self.assertNotEqual(s.interpolate(method='spline', order=3, s=0)[5], | ||
s.interpolate(method='spline', order=3)[5]) | ||
|
||
def test_metadata_propagation_indiv(self): | ||
|
||
# groupby | ||
|
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.
Should pass
**kwargs
, or only supportUnivariateSpline
? (Also 1749th line)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.
It should support more types. I only wrote one so far.