简体   繁体   中英

How to export result obtained from Python into excel

I did some analysis of my.txt file using python. Each data produced a set of results. I need to transfer the whole results into a single excel file. You can see my results from this image enter image description here . Also, I want to mention each txt file name along with the results in the excel sheet. Can anyone help this matter?

I presume that you are using pandas. Pandas have a build in function to export to excel.

df_excel.to_excel("output.xlsx") 

If you want to add the name of the textfile, simply add the name to the corresponding rows.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM