From 4825a65a1b96d447ca3e3bce0ce1de85c58a8b4b Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Sat, 10 Oct 2020 13:57:41 -0700 Subject: [PATCH 1/4] DOC: add basic description to interpolate method This basic description can be useful for users who don't know what interpolation is and this may help with SEO to search for more powerful method than the `.fillna()` method. --- pandas/core/generic.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 86b6c4a6cf575..b937a07feff28 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6838,6 +6838,9 @@ def interpolate( **kwargs, ) -> Optional[FrameOrSeries]: """ + Fill in intermediate, missing values based on surrounding data using a + given interpolation technique (see ``method`` below). + Please note that only ``method='linear'`` is supported for DataFrame/Series with a MultiIndex. From 2d981a14fd3df2a5aec4d8c5480774a42fca2591 Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Sat, 10 Oct 2020 15:13:32 -0700 Subject: [PATCH 2/4] DOC: update fillna info to contrast interpolate In the "See Also" section of interpolate, the fillna method sounds very similar, but it actually is more limited. So this commit makes this distinction more clear. --- pandas/core/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index b937a07feff28..89cf4c9214b98 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6916,7 +6916,7 @@ def interpolate( See Also -------- - fillna : Fill missing values using different methods. + fillna : Fill missing values using a set value or existing values. scipy.interpolate.Akima1DInterpolator : Piecewise cubic polynomials (Akima interpolator). scipy.interpolate.BPoly.from_derivatives : Piecewise polynomial in the From 2e65c4c766728565d068a232a3c1990ffce32281 Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Sun, 11 Oct 2020 12:08:39 -0700 Subject: [PATCH 3/4] DOC: condense interpolate method summary text --- pandas/core/generic.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 89cf4c9214b98..7eea5d881d772 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6838,8 +6838,7 @@ def interpolate( **kwargs, ) -> Optional[FrameOrSeries]: """ - Fill in intermediate, missing values based on surrounding data using a - given interpolation technique (see ``method`` below). + Fill NaN values using an interpolation method. Please note that only ``method='linear'`` is supported for DataFrame/Series with a MultiIndex. From 52b62400d08f10fd89b747100756d4e9d6159d2b Mon Sep 17 00:00:00 2001 From: Eric Leung Date: Mon, 12 Oct 2020 08:22:34 -0700 Subject: [PATCH 4/4] DOC: revert description change of fillna --- pandas/core/generic.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 7eea5d881d772..5e5a77fe24cb5 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6915,7 +6915,7 @@ def interpolate( See Also -------- - fillna : Fill missing values using a set value or existing values. + fillna : Fill missing values using different methods. scipy.interpolate.Akima1DInterpolator : Piecewise cubic polynomials (Akima interpolator). scipy.interpolate.BPoly.from_derivatives : Piecewise polynomial in the