Last active
March 16, 2018 18:49
-
-
Save tkheyfets/4176fe93e4af5fceca0dbfd1b504b920 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 function_name (collection, k): | |
result = {} | |
for x in collection: | |
prop = x[k] | |
if prop not in result: | |
result[prop] = [] | |
result[prop].append(x) | |
return result | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment