0

I am assigning a (500000,) array of type float64 to two different variables. How can I mangae to avoid the following error message?

newx = newy = np.zeros((new_num,))
numpy.core._exceptions._ArrayMemoryError: Unable to allocate 3.81 MiB for an array with shape (500000,) and data type float64

Note: I use a 64 version of python that is installed on a Windows 10 machine and am running the script on visual studio code. Since I don't have admin permission, I cannot change Windows settings as mentioned in this link Unable to allocate array with shape and data type.

Roosha
  • 89
  • 3
  • 10
  • 2
    Does this answer your question? [Unable to allocate array with shape and data type](https://stackoverflow.com/questions/57507832/unable-to-allocate-array-with-shape-and-data-type) – paulsm4 Apr 22 '22 at 17:53
  • 1
    Sure, the part relevant to my case was the Windows case. Since I am not admin on my machine, I would rather not mess with the settings as suggested by one of the answers. I can try it as temporary solution only and change settings back to their original values. Thank you for directing me to this link! – Roosha Apr 22 '22 at 18:14
  • 2
    Also note that you should be using the *64-bit version of Python* (on the off chance you're not already doing so, or you might inadvertently be picking up a 32-bit version). It's certainly worth double-checking :) – paulsm4 Apr 22 '22 at 18:50
  • The number of variables is irrelevant. There is only one array, that's the problem. Also, this has nothing to do with memory leaks, memory management... – juanpa.arrivillaga Apr 22 '22 at 19:11
  • Thank you for editing tags. I do use 64-bit version of the python. – Roosha Apr 22 '22 at 19:32

0 Answers0