Huge memory usage of loading large dictionaries in memory

前端 未结 4 2038
被撕碎了的回忆
被撕碎了的回忆 2020-12-04 08:54

I have a file on disk that\'s only 168MB. It\'s just a comma separated list of word,id. The word can be 1-5 characters long. There\'s 6.5 million lines.

I created a

4条回答
  •  渐次进展
    2020-12-04 09:50

    I have the same problem though I'm later. The others has answered this question well. And I offer an easy to use(maybe not so easy :-) ) and rather efficient alternative, that's pandas.DataFrame. It performs well in memory usage when saving large data.

提交回复
热议问题