Alternatives to keeping large lists in memory (python)

后端 未结 9 1352
再見小時候
再見小時候 2020-12-08 16:50

If I have a list(or array, dictionary....) in python that could exceed the available memory address space, (32 bit python) what are the options and there relative speeds? (o

相关标签:
9条回答
  • 2020-12-08 17:45

    Did you check shelve python module which is based on pickle?

    http://docs.python.org/library/shelve.html

    0 讨论(0)
  • 2020-12-08 17:47

    Well, if you are looking for speed and your data is numerical in nature, you could consider using numpy and PyTables or h5py. From what I remember, the interface is not as nice as simple lists, but the scalability is fantastic!

    0 讨论(0)
  • 2020-12-08 17:51

    Modern operating systems will handle this for you without you having to worry about it. It's called virtual memory.

    0 讨论(0)
提交回复
热议问题