Answers for "convert dictionary to numpy 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
0

data dictionary python into numpy

lst = list(data_dict.items())
array = np.array(lst)
Posted by: Guest on July-27-2021

Code answers related to "convert dictionary to numpy array"

Python Answers by Framework

Browse Popular Code Answers by Language