python dict to key value list code example
Example 1: python get dict values as list
food_list=list(data.values())
print(food_list)
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: python convert dict_keys to list
d = {1:1, 2:2, 3:3}
d_keys_list = list(d.keys())