0

I have a problem where i use pandas.core.series.Series.interpolate with cubic method and it's fill everything except the first and the last index

Here is my code :

   train = data.iloc[:, column_no-1].dropna()
   train = outlier(train, lower=lo, upper=hi)
   train = train.interpolate(method='cubic')

I tried to use scipy.interpolate but it must input both x and y so what is x and y and will it's work for my case.

Any recommendation of how to do it.

Thank you for your consideration.

  • Interpolation is used to fill missing values between. Since the edges are problematic, you may need to extrapolate: https://stackoverflow.com/questions/22491628/extrapolate-values-in-pandas-dataframe – ALollz Jun 25 '19 at 02:20
  • thank you,ALollz from the linked you given i found that we can use ffill() and bfill() here is my code: train = train.interpolate(method='cubic').ffill().bfill() – Somphon Rueangari Jun 25 '19 at 02:53

0 Answers0