Skip to content

Commit 8cd11de

Browse files
anishkarkianishkarki
authored andcommitted
DOC: Revert added non-sequential index example in interpolate() docstring
1 parent 62a2359 commit 8cd11de

File tree

1 file changed

+1
-17
lines changed

1 file changed

+1
-17
lines changed

pandas/core/generic.py

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7802,30 +7802,14 @@ def interpolate(
78027802
2 2.0 3.0 -3.0 9.0
78037803
3 2.0 4.0 -4.0 16.0
78047804
7805-
# Using polynomial interpolation.
7805+
Using polynomial interpolation.
78067806
78077807
>>> df["d"].interpolate(method="polynomial", order=2)
78087808
0 1.0
78097809
1 4.0
78107810
2 9.0
78117811
3 16.0
78127812
Name: d, dtype: float64
7813-
# Using index method for linear interpolation with
7814-
# non-sequential index.
7815-
>>> data_non_seq = {"val": [1, np.nan, 3]}
7816-
>>> df_non_seq = pd.DataFrame(
7817-
... data, index=[0, 1, 6]
7818-
... ) # a non-sequential index to demonstrate the difference
7819-
>>> df_non_seq
7820-
val
7821-
0 1.0
7822-
1 NaN
7823-
6 3.0
7824-
>>> df_non_seq["val"].interpolate(method="index").round(1)
7825-
0 1.0
7826-
1 1.3
7827-
6 3.0
7828-
Name: val, dtype: float64
78297813
"""
78307814
inplace = validate_bool_kwarg(inplace, "inplace")
78317815

0 commit comments

Comments
 (0)