문제

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

도움이 되었습니까?

해결책

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.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top