这是一次更新
使用Jupyter或Spyder UI运行代码时,不会发生内存不足错误。有什么想法吗?
我正在加载大小约为250 MB的CSV文件,当程序第一次运行时不会抛出“内存不足”错误,但是当加载下一个csv文件时它会抛出它。
当我收到此错误时,我停止了程序并重新运行它,有趣的是我不会出现内存错误但是在加载下一个csv文件时,我再次收到错误。
我的电脑在RAM中剩下8 GB,所以我不明白为什么内存上限在哪里?
我用来加载csv文件的代码是:
df = pd.read_csv(csvfile, index_col=False, sep=',', low_memory=False)
追踪错误
Traceback (most recent call last):
File "C:/Users/jvivas/Dropbox/Private/Personal/Github/CSVFormattingTools/XOMCSVFormattingTool_version2.py", line 34, in <module>
df = pd.read_csv(csvfile, index_col=False, sep=',', low_memory=False)
File "C:\Program Files (x86)\Python35-32\lib\site-packages\pandas\io\parsers.py", line 562, in parser_f
return _read(filepath_or_buffer, kwds)
File "C:\Program Files (x86)\Python35-32\lib\site-packages\pandas\io\parsers.py", line 325, in _read
return parser.read()
File "C:\Program Files (x86)\Python35-32\lib\site-packages\pandas\io\parsers.py", line 815, in read
ret = self._engine.read(nrows)
File "C:\Program Files (x86)\Python35-32\lib\site-packages\pandas\io\parsers.py", line 1314, in read
data = self._reader.read(nrows)
File "pandas\parser.pyx", line 808, in pandas.parser.TextReader.read (pandas\parser.c:8643)
File "pandas\parser.pyx", line 896, in pandas.parser.TextReader._read_rows (pandas\parser.c:9772)
File "pandas\parser.pyx", line 1865, in pandas.parser.raise_parser_error (pandas\parser.c:23295)
pandas.io.common.CParserError: Error tokenizing data. C error: out of memory
感谢任何帮助
由于