Best way to sort 1M records in Python

前端 未结 11 1613
慢半拍i
慢半拍i 2020-12-05 08:41

I have a service that runs that takes a list of about 1,000,000 dictionaries and does the following

myHashTable = {}
myLists = { \'hits\':{}, \'misses\':{},          


        
11条回答
  •  北海茫月
    2020-12-05 09:42

    sorted(myLists[key], key=mylists[key].get, reverse=True)
    

    should save you some time, though not a lot.

提交回复
热议问题