Skip to content

Instantly share code, notes, and snippets.

@eightysteele
Created November 15, 2013 15:36
Show Gist options
  • Select an option

  • Save eightysteele/7486258 to your computer and use it in GitHub Desktop.

Select an option

Save eightysteele/7486258 to your computer and use it in GitHub Desktop.
def trimmer(rec):
keep_keys = ['class', 'country']
for key in rec.keys():
if key not in keep_keys:
rec.pop(key)
return rec
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment