In Python, I have a dict has pertinent information
arrowCell = {'up': False, 'left': False, 'right': False}
How do I make an array with i rows and j columns of these dicts?
In Python, I have a dict has pertinent information
arrowCell = {'up': False, 'left': False, 'right': False}
How do I make an array with i rows and j columns of these dicts?
How to make a two dimensional i & j is explained really well on the site already at this: How to define two-dimensional array in python link.
Hope this helps, cheers!
Although your problem isn't clear but if you want keys and values of dictionary in form of ndarray you can try this:
l = {'up': False, 'left': False, 'right': False}
a = []
for key, value in l.iteritems():
temp = [key,value]
a.append(temp)
result of that will be :
>>> a
[['right', False], ['up', False], ['left', False]]
or you can just try l.items(), result of which will be :
>>> l.items()
[('right', False), ('up', False), ('left', False)]
hope that helps and link given above gives you best way to define two dimensional array.