how to save output from dataframe info to file a excel or text file

后端 未结 1 1229
自闭症患者
自闭症患者 2020-12-21 12:23

How can I write

df.info() to file?

I would like to include this in a sheet of the excel file where I write my df to using df

1条回答
  •  囚心锁ツ
    2020-12-21 13:04

    I would try the following:

    f = open('df.info', 'w+')
    
    df.info(buf=f)
    
    f.close()
    

    0 讨论(0)
提交回复
热议问题