[英]how to save info from local html file in a text document with python?
[英]how to save output from dataframe info to file a excel or text file
我怎么写
df.info()
归档?
我想将此包含在excel文件的表格中,在其中我将df
编写为使用df.to_excel
。
根据文档( pandas.DataFrame.info ),它返回一个
buf:可写缓冲区,默认为sys.stdout
我会尝试以下方法:
f = open('df.info', 'w+')
df.info(buf=f)
f.close()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.