我有一个320 MB的逗号分隔(csv)文件。 要阅读它,我使用
pd.read_csv(loggerfile, header = 2)
我有8 GB的Ram(5个是免费的),这怎么会抛出一个错误?
File "C:\Users\me\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\io\parsers.py", line 443, in parser_f
return _read(filepath_or_buffer, kwds)
File "C:\Users\me\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\io\parsers.py", line 235, in _read
return parser.read()
File "C:\Users\me\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\io\parsers.py", line 686, in read
ret = self._engine.read(nrows)
File "C:\Users\me\AppData\Local\Continuum\Anaconda\lib\site-packages\pandas\io\parsers.py", line 1130, in read
data = self._reader.read(nrows)
File "parser.pyx", line 727, in pandas.parser.TextReader.read (pandas\parser.c:7146)
File "parser.pyx", line 777, in pandas.parser.TextReader._read_low_memory (pandas\parser.c:7725)
File "parser.pyx", line 1788, in pandas.parser._concatenate_chunks (pandas\parser.c:21033)
MemoryError
编辑:
Windows 7 Enterprise 64位
Anaconda 2.0.1 x86< - 也许x86_64会更好吗?
在我的内存上限达到之前(在任务管理器中看到),即使是在3 Gb - 32位机器上,也会发生内存错误。