[Numpy-discussion] array of random numbers fails to construct

DAVID SAROFF (RIT Student) dps7802 at rit.edu
Sun Dec 6 15:39:24 EST 2015


This works. A big array of eight bit random numbers is constructed:

import numpy as np

spectrumArray = np.random.randint(0,255, (2**20,2**12)).astype(np.uint8)



This fails. It eats up all 64GBy of RAM:

spectrumArray = np.random.randint(0,255, (2**21,2**12)).astype(np.uint8)


The difference is a factor of two, 2**21 rather than 2**20, for the extent
of the first axis.

-- 
David P. Saroff
Rochester Institute of Technology
54 Lomb Memorial Dr, Rochester, NY 14623
david.saroff at mail.rit.edu | (434) 227-6242
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/numpy-discussion/attachments/20151206/6084e08d/attachment.html>


More information about the NumPy-Discussion mailing list