Out of memory while reading excel file

Irmen de Jong irmen.NOSPAM at xs4all.nl
Wed May 10 13:26:08 EDT 2017


On 10-5-2017 17:12, Mahmood Naderan wrote:

> So, I think numpy is unable to manage the memory.

That assumption is very likely to be incorrect.


>> np.array([[i.value for i in j] for j in p.rows])

I think the problem is in the way you feed your excel data into the numpy array
constructor. The code above builds many redundant python lists from the data you already
have in memory, before even calling the numpy array function.

I strongly suggest finding a proven piece of code to read large excel files like the
example from Peter Otten's reply.

Irmen




More information about the Python-list mailing list