我正在PC(iCore 7和16 G GB ram)上运行PyCharm 64位。
代码是一个循环,处理相同的数据,但是更改一个会影响输出的变量。
对于同一变量,该代码大约需要40分钟才能在不同的值之间循环。大约12分钟后,我收到错误消息(粘贴在下面)。
关于如何解决此问题的任何想法?
我尝试将Xms和Xmx设置为更大的内存,然后重新启动,但仍然出现错误。 我尝试在其他两台计算机(一台Mac和一台PC)上运行代码-它可以在其他计算机上运行。 我试过运行Anaconda Navigator并使用笔记本,这行得通。
我得到的错误如下:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Users\Mark\AppData\Local\Programs\Python\Python37-32\lib\tkinter\__init__.py", line 1705, in __call__
File "C:\Users\Mark\VineLifeCode\App.py", line 192, in run
process_tree(tree_file, data_path, Save_path, deps, dthetas, epss, nf, nspans, res)
File "C:\Users\Mark\VineLifeCode\App.py", line 258, in process_tree
pd.DataFrame(df_path).to_excel(writer_path, sheet_name=sheet_name)
File "C:\Users\Mark\Desktop\Tree_code (IDE)\venv\lib\site-packages\pandas\core\generic.py", line 2127, in to_excel
File "C:\Users\Mark\Desktop\Tree_code (IDE)\venv\lib\site-packages\pandas\io\formats\excel.py", line 662, in write
File "C:\Users\Mark\Desktop\Tree_code (IDE)\venv\lib\site-packages\pandas\io\excel.py", line 1993, in write_cells
File "C:\Users\Mark\Desktop\Tree_code (IDE)\venv\lib\site-packages\xlsxwriter\worksheet.py", line 69, in cell_wrapper
File "C:\Users\Mark\Desktop\Tree_code (IDE)\venv\lib\site-packages\xlsxwriter\worksheet.py", line 411, in write
File "C:\Users\Mark\Desktop\Tree_code (IDE)\venv\lib\site-packages\xlsxwriter\worksheet.py", line 433, in _write
File "C:\Users\Mark\Desktop\Tree_code (IDE)\venv\lib\site-packages\xlsxwriter\worksheet.py", line 577, in _write_number
MemoryError