title: How to define a matrix to have the lowest memory consumption?
body: <p>I have 10000000 integers that I want to add in a matrix of 10000000 * 256 dimensions.I have defined three types of matrices to compare which definition has the lowest memory consumption I have shown below:</p>
  
  <pre><code>1) np.zeros ([row, col], dtype = int)
  2) np.empty ([row, col], dtype = int)
  3) csr_matrix ((row, col), dtype = np.int) .toarray ()
  </code></pre>
  
  <p>Among these definitions, the matrix defined as Spars has the least amount of memory. The first two definitions each have 2 GB of memory usage but the last matrix consumes 1 GB of memory. Are there other methods or libraries that compress the matrix as much as possible and consume less memory?</p>