Answers for "convert dict values to list python"

0

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']]
Posted by: Guest on May-06-2020
1

dict_values to list python

list(d.values())
Posted by: Guest on June-12-2020

Code answers related to "convert dict values to list python"

Python Answers by Framework

Browse Popular Code Answers by Language