Fill NaN values wit mean of previous rows?

后端 未结 0 1416
执笔经年
执笔经年 2020-12-14 04:08

I have to fill the nan values of a column in a dataframe with the mean of the previous 3 instances. Here is the following example:

df = pd.DataFrame({\'col1\'         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题