I am trying to load a database from my python code which contains a list of dictionaries. For each item of the list the dictionary contains the name of a file a sub-list which contains n different dictionaries which a file name and data which is a numpy matrix of size 40x40x3 and correspond to an image. I want inside a for loop store all those images in a numpy file which size Nx40x40x3.
for item in dataset:
print item["name"] # the name of the list
print item["data"] # a list of dictionaries
for row in item["data"]:
print row["sub_name"] # the name of the image
print row["sub_data"] # contains an numpy array (my image)
How cam I construct a numpy array and add all the images?