python dictionary to array

Solutions on MaxInterview for python dictionary to array by the best coders in the world

we are a community of more than 2 million smartest coders
registration for
employee referral programs
are now open
get referred to google, amazon, flipkart and more
register now
  
pinned-register now
showing results for - "python dictionary to array"
Serena
17 May 2019
1dict = {"a": 1, "b": 2, "c": 3, "d": 4}
2
3data = list(dict.items())
4an_array = np.array(data)
5
6print(an_array)
7OUTPUT
8[['a' '1']
9 ['b' '2']
10 ['c' '3']
11 ['d' '4']]