prre72
prre72

Reputation: 717

Cannot interpolate on Pandas Dataframes

I am trying to interpolate missing values on my Pandas Dataframe:

              a   b    c
2013-11-19   20   28  55 
2013-11-20   27   29  54
2013-11-21  NaN  NaN  NaN
2013-11-22  NaN  NaN  NaN
2013-11-23  NaN  NaN  NaN
2013-11-14   34   62   89

unfortunately if I try to use

df1 = df1.interpolate()

i get the following error message:

TypeError: interpolate() takes at least 2 arguments (1 given)

any ideas?

Thanks

Upvotes: 0

Views: 866

Answers (1)

Shravan
Shravan

Reputation: 2723

Latest version of pandas resolves this issue.
If you still want to use interpolate without upgrading pandas use can do this:

for col in df1.columns:
    df1[col] = df1[col].interpolate()

Refer this for more info.

Upvotes: 1

Related Questions