Python 2.7 - statsmodels - formatting and writing summary output

后端 未结 5 1728
独厮守ぢ
独厮守ぢ 2021-02-05 20:55

I\'m doing logistic regression using pandas 0.11.0(data handling) and statsmodels 0.4.3 to do the actual regression, on Mac OSX Lion.

I\'m goin

5条回答
  •  星月不相逢
    2021-02-05 21:29

    There is actually a built-in method documented in the documentation here:

    f = open('csvfile.csv','w')
    f.write(result.summary().as_csv())
    f.close()
    

    I believe this is a much easier (and clean) way to output the summaries to csv files.

提交回复
热议问题