pandas 删除有缺失值的个案,做回归分析
生活随笔
收集整理的這篇文章主要介紹了
pandas 删除有缺失值的个案,做回归分析
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
如題:
因為回歸分析不能有缺失值
import statsmodels.api as sm df_result3 = df.dropna(axis = 0, subset = ['politic_enter1very','poli_effect', 'poli_know', 'authoritorian', 'idea_left_is_the_big_value' ]) df_result3.shapey = df_result3['politic_enter1very'] x = df_result3[['poli_effect', 'poli_know', 'authoritorian', 'idea_left_is_the_big_value']] x = sm.add_constant(x) model = sm.OLS(y, x).fit()?
總結
以上是生活随笔為你收集整理的pandas 删除有缺失值的个案,做回归分析的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: win 8 pe怎么引导修复工具 Win
- 下一篇: 硬盘分区教程怎么格式化 硬盘分区格式化教