Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save muthuspark/442bd75f3dae4e73c8b2bbe0edba48d8 to your computer and use it in GitHub Desktop.
Save muthuspark/442bd75f3dae4e73c8b2bbe0edba48d8 to your computer and use it in GitHub Desktop.
convert a dictionary to array in python
# A list of the keys of dictionary
list_keys = [ k for k in dict ]
# or a list of the values
list_values = [ v for v in dict.values() ]
# or just a list of the list of key value pairs
list_key_value = [ [k,v] for k, v in dict.items() ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment