Skip to content

Instantly share code, notes, and snippets.

@avalanchy
Created September 28, 2016 12:21
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save avalanchy/edd5e93a6b0e72f69a929ef0588c48be to your computer and use it in GitHub Desktop.
Save avalanchy/edd5e93a6b0e72f69a929ef0588c48be to your computer and use it in GitHub Desktop.
covert all dict keys to uppercase in python.
def _uppercase_for_dict_keys(lower_dict):
upper_dict = {}
for k, v in lower_dict.items():
if isinstance(v, dict):
v = _uppercase_for_dict_keys(v)
upper_dict[k.upper()] = v
return upper_dict
@phloreenm
Copy link

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment