Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 20057

How to fix this MemoryError: Unable to allocate in Python

$
0
0

Here is the code I have

out = out.T.groupby(level=0, sort=False).sum().T

and it gives this error

MemoryError: Unable to allocate 13.1 GiB for an array with shape (37281, 47002) and data type int64

I tried this

out = out.T.groupby(level=0, sort=False).sum().astype(np.int8).T

but still getting the same error!

Any idea how to fix it?


Viewing all articles
Browse latest Browse all 20057

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>