Extrapolate (and Interpolate) Pandas DataFrame

Viewed 954

I have a pandas dataframe as below

enter image description here

(Year index is int64, Total_Population_Final is float.)

I want to create a linear interpolation (and extrapolation), but using pd.interpolate() I only seem to be able to create an interpolation between the two years (not extending it forward and backward in time).

1 Answers

Update: I have solved this (for anyone interested for future reference), using:

pd.interpolate(method="spline", order=1, limit_direction="both")
Related