Created
January 16, 2017 16:44
-
-
Save rocapp/5ada903e83cf0b1da848aa05820147b8 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
def get_best(file): | |
words = list() | |
with open(file, 'r') as f: | |
bf = json.load(f) | |
sbf = sorted(bf.items(), key=itemgetter(1), reverse=True) | |
sbf = [bb[0] for bb in sbf] | |
return sbf[0:int(len(sbf)/2.0)] # chooses the top half |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment