Skip to main content
edited tags
Link
NPE
  • 503k
  • 114
  • 970
  • 1k
Source Link
chad
  • 717
  • 1
  • 9
  • 24

Numpy random memory error

Hi I have a simple line that creates a random array for a rather large dataset:

import numpy as np
import random
N=276233
L=138116

np.random.random([L,N])

But i get this error:

Traceback (most recent call last):
  File "<string>", line 3 (23), in <module>
  File "mtrand.pyx", line 760, in mtrand.RandomState.random_sample (numpy\random\mtrand\mtrand.c:5713)
  File "mtrand.pyx", line 137, in mtrand.cont0_array (numpy\random\mtrand\mtrand.c:1300)
MemoryError

What is the solution and what is the limit of the array ?