Openpyxl load_workbook and save too long

The following lines take 45 seconds of the first and more than one and a half minutes. Something.xls is 4 MB in size and the changes are minor. Is something wrong here?

something = openpyxl.load_workbook('Something.xlsx') something.save('Something.xlsx') 

Some details: I use Python 2.7.3 on Windwos 7, the book has 2 sheets, the first of which has 67610 lines, I do not use any network to do this work.

+4
source share
1 answer

So, I created an excel 67k worksheet with four columns and random decimal data - and the worksheet was almost 5 MB, so> 1000x what you said in your question. Given that this is a decent amount of data, I would suggest using an optimized reader, rather than a regular one. Here is a link to the tutorial:

https://openpyxl.readthedocs.org/en/latest/optimized.html

Hope this helps!

+6
source

Source: https://habr.com/ru/post/1493222/


All Articles