Pandas to_excel- How to make it faster

后端 未结 1 496
被撕碎了的回忆
被撕碎了的回忆 2021-01-12 14:02

I have a dataframe with 12,000 rows and 34 columns. It takes around 15 sec for pandas to write this to the excel. I read few discussion about to_excel function and one way t

相关标签:
1条回答
  • 2021-01-12 14:45

    You can use pyexcelerate to get a much faster speed.

    from pyexcelerate import Workbook
    
    values = [res_df.columns] + list(res_df.values)
    wb = Workbook()
    wb.new_sheet('sheet name', data=values)
    wb.save('outputfile.xlsx')
    
    0 讨论(0)
提交回复
热议问题