Skip to content

Commit 1f6e44a

Browse files
DOC: Update interpolation docstring (#49681)
* DOC: Update interpolation docstring to highlight slinear and spline differences between pandas and scipy. * Fix typos. * Shorter docstring comment.
1 parent 9daf62f commit 1f6e44a

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

pandas/core/generic.py

+6-3
Original file line numberDiff line numberDiff line change
@@ -7247,12 +7247,15 @@ def interpolate(
72477247
given length of interval.
72487248
* 'index', 'values': use the actual numerical values of the index.
72497249
* 'pad': Fill in NaNs using existing values.
7250-
* 'nearest', 'zero', 'slinear', 'quadratic', 'cubic', 'spline',
7250+
* 'nearest', 'zero', 'slinear', 'quadratic', 'cubic',
72517251
'barycentric', 'polynomial': Passed to
7252-
`scipy.interpolate.interp1d`. These methods use the numerical
7252+
`scipy.interpolate.interp1d`, whereas 'spline' is passed to
7253+
`scipy.interpolate.UnivariateSpline`. These methods use the numerical
72537254
values of the index. Both 'polynomial' and 'spline' require that
72547255
you also specify an `order` (int), e.g.
7255-
``df.interpolate(method='polynomial', order=5)``.
7256+
``df.interpolate(method='polynomial', order=5)``. Note that,
7257+
`slinear` method in Pandas refers to the Scipy first order `spline`
7258+
instead of Pandas first order `spline`.
72567259
* 'krogh', 'piecewise_polynomial', 'spline', 'pchip', 'akima',
72577260
'cubicspline': Wrappers around the SciPy interpolation methods of
72587261
similar names. See `Notes`.

0 commit comments

Comments
 (0)