Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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