出现:statsmodels.tools.sm_exceptions.MissingDataError: exog contains inf or nans

只需要把数据中的inf或者nan变成0即可,复制下面代码:

import statsmodels.api as sm
data[np.isnan(data)] = 0
data[np.isinf(data)] = 0

 

相关文章:

  • 2021-09-05
  • 2022-12-23
  • 2019-07-04
  • 2022-12-23
  • 2021-12-30
  • 2022-12-23
  • 2021-10-04
  • 2022-01-06
猜你喜欢
  • 2022-12-23
  • 2021-04-18
  • 2021-07-18
  • 2021-08-13
  • 2021-10-08
  • 2022-12-23
  • 2022-01-07
相关资源
相似解决方案