在缺失值填补上如果用前后的均值填补中间的均值,比如,0,空,1,我们希望中间填充0.5;或者0,空,空,1,我们希望中间填充0.33,0.67这样。可以用pandas的函数进行填充,因为这个就是线性插值法

df..interpolate()

dd=pd.DataFrame(data=[0,np.nan,np.nan,1])

dd.interpolate() 

 python线性插值

 python线性插值

 

 

相关文章:

  • 2021-06-12
  • 2021-12-06
  • 2021-12-06
  • 2021-11-22
  • 2021-12-29
猜你喜欢
  • 2021-12-16
  • 2022-12-23
  • 2021-05-12
  • 2021-12-06
  • 2021-10-21
  • 2021-12-29
  • 2021-11-14
相关资源
相似解决方案