Python: List vs Dict for look up table

后端 未结 8 1120
爱一瞬间的悲伤
爱一瞬间的悲伤 2020-11-22 10:41

I have about 10million values that I need to put in some type of look up table, so I was wondering which would be more efficient a list or dict?

I know

8条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-11-22 10:48

    if data are unique set() will be the most efficient, but of two - dict (which also requires uniqueness, oops :)

提交回复
热议问题