title: MemoryError: Unable to allocate 3.78 GiB for an array with shape (802, 842, 1502) and data type float32
body: <p>I have results from a large simulation that I want to manipulate.</p>
  
  <p>Now, it seems that it might be a bit too much for my computer to handle, as python stops and tells me:</p>
  
  <pre class="lang-none prettyprint-override"><code>MemoryError: Unable to allocate 3.78 GiB for an array with shape (802, 842, 1502)
  </code></pre>
  
  <p>and data type <code>float32</code>.</p>
  
  <p>I do not manage to change /proc/sys/vm/overcommit_memory, as even with "sudo", the permission is denied.</p>
  
  <p>So, I thought about reducing the precision of the numbers in the array, since the precision is important during the simulation to avoid accumulative errors, but less so afterwards.</p>
  
  <p>Let's say the array is called <code>A</code>, I tried:</p>
  
  <pre><code>A = np.float16(A)
  </code></pre>
  
  <p>But obviously, to do that, you manipulate <code>A</code>, which is still in <code>float32</code>, and it raises the same error.</p>
  
  <p>So...any better ideas?</p>