Memory Error - Printable Version +- Python Forum (https://python-forum.io) +-- Forum: Python Coding (https://python-forum.io/forum-7.html) +--- Forum: Data Science (https://python-forum.io/forum-44.html) +--- Thread: Memory Error (/thread-10542.html) |
Memory Error - jason413 - May-24-2018 I manage a dataset of AMEX, NASDAQ and AMEX stocks over last 40 years. I encountered a memory error shown as follows: File "C:\Users\lokac\Anaconda3\lib\site-packages\pandas\core\algorithms.py", line 1379, in take_nd out = np.empty(out_shape, dtype=dtype) MemoryError Many thanks for helping. RE: Memory Error - j.crater - May-24-2018 Post the full error traceback message in error tags, and if possible also relevant piece of code in Python code tags. You can find help here. RE: Memory Error - jason413 - May-24-2018 If I reduce the sample length to 10 years, the python code works well without any memory error. Here is the tracking record:
RE: Memory Error - volcano63 - May-24-2018 You are obviously running out of memory. pandas is a memory hog - see this article. Quoting the authorQuote:my rule of thumb for pandas is that you should have 5 to 10 times as much RAM as the size of your dataset You probably should find a way to split your data into chunks and process it in smaller portions - or increase the amount of available RAM RE: Memory Error - DeaD_EyE - May-24-2018 Iterating is what you need. You chunk the data into parts, that it fits into your memory. Then you processing them, saving the results and proceed with the next chunk. RE: Memory Error - wavic - May-24-2018 It's better to use a generator. It's super memory efficient. RE: Memory Error - nilamo - Jun-21-2018 http://www.crucial.com/ |