Answers for "dict values to array"

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
2

list of dictionary values

d.values()
Posted by: Guest on March-10-2020

Python Answers by Framework

Browse Popular Code Answers by Language