python dictionary to list of keys and values code example
Example 1: python list keys from dictionary
# Basic syntax:
list_of_keys = list(dictionary.keys())
Example 2: python dictionary to array
dict = {"a": 1, "b": 2, "c": 3, "d": 4}
data = list(dict.items())
an_array = np.array(data)
print(an_array)
OUTPUT
[['a' '1']
['b' '2']
['c' '3']
['d' '4']]
Example 3: dict_keys to list
list(newdict.keys())