title: Create a Large Numpy Array
body: <p>I am trying to create a symmetrical numpy array with values ranging between 0.4- 1 with 20000*20000 rows and columns. However, I am getting a memory error when I create this big array.
   Please find my code below.</p>
  
  <p>import numpy as np</p>
  
  <pre><code>def random_symmetric_matrix(n):
      _R = np.random.uniform(0.4,1,n*(n-1)/2)
      P = np.zeros((n,n))
      P[np.triu_indices(n, 1)] = _R
      P[np.tril_indices(n, -1)] = P.T[np.tril_indices(n, -1)]
      print P
      np.savetxt("b.txt",P, delimiter=' ')
      return P
  
  random_symmetric_matrix(6000)
  </code></pre>