Skip to content

Instantly share code, notes, and snippets.

@kentquirk
Last active September 10, 2016 17:50
Show Gist options
  • Save kentquirk/c9b382c8d467e17f3935981022c9c5d7 to your computer and use it in GitHub Desktop.
Save kentquirk/c9b382c8d467e17f3935981022c9c5d7 to your computer and use it in GitHub Desktop.
Simple python
output = {}
for element in input:
if output.has_key(element["owner"]):
output[element["owner"]].append(element["pet"])
else:
output[element["owner"]] = [element["pet"]]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment