Created
March 23, 2018 01:27
-
-
Save solidpple/30dcc8fed8536d635df46fa107b13952 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import heapq | |
topK = 10 | |
item_score_dict = {'1': 3,'2':2,'3':5,'4':1, '8':3} | |
ranklist = heapq.nlargest(topK, item_score_dict, key=item_score_dict.get) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment