File tree Expand file tree Collapse file tree 1 file changed +8
-11
lines changed
Expand file tree Collapse file tree 1 file changed +8
-11
lines changed Original file line number Diff line number Diff line change @@ -7802,7 +7802,8 @@ 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 linear and index method for linear interpolation.
7805+ Using index method for linear interpolation
7806+ with non-sequential index.
78067807 >>> data = {"val": [1, np.nan, 3]}
78077808 >>> df = pd.DataFrame(
78087809 ... data, index=[0, 1, 6]
@@ -7812,16 +7813,12 @@ def interpolate(
78127813 0 1.0
78137814 1 NaN
78147815 6 3.0
7815- >>> df.interpolate(method="linear")
7816- val
7817- 0 1.0
7818- 1 2.0
7819- 6 3.0
7820- >>> df.interpolate(method="index").round(1)
7821- val
7822- 0 1.0
7823- 1 1.3
7824- 6 3.0
7816+ >>> df["val"].interpolate(method="index").round(1)
7817+ 0 1.0
7818+ 1 1.3
7819+ 6 3.0
7820+ Name: val, dtype: float64
7821+
78257822 Using polynomial interpolation.
78267823
78277824 >>> df["d"].interpolate(method="polynomial", order=2)
You can’t perform that action at this time.
0 commit comments