Created
June 26, 2019 01:28
-
-
Save muthuspark/442bd75f3dae4e73c8b2bbe0edba48d8 to your computer and use it in GitHub Desktop.
convert a dictionary to array in python
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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