Answers for "convert dictionary to 2d array python"

1

2d dictionary in python

# It would have the following syntax
dict_names = {'d1' : {'name':'bob', 'place':'lawn', 'animal':'man'},
              'd2' : {'name':'spot', 'place':'bed', 'animal':'dog'}}

# You can then look things up like
>>> dict_names['d1']['name']
'bob'
Posted by: Guest on August-31-2021
0

convert dictionary to 2d array python

If you have a 2d array in the dictionary than this is what you do:

dictionary = {'array': [elements]} #The elements are smaller lists

New_Array = dictionary['array']
Posted by: Guest on March-15-2022

Code answers related to "convert dictionary to 2d array python"

Python Answers by Framework

Browse Popular Code Answers by Language