I am having a database of 7000 objects (list_of_objects), each one of these files contains a numpy array with size of 10x5x50x50x3. I would like to create a 5d numpy array that will contain 7000*10x5x50x50x3. I tried to do so using two for-loops. My sample code:
fnl_lst = []
for object in list_of_objects:
my_array = read_array(object) # size 10x5x50x50x3
for ind in my_array:
fnl_lst.append(ind)
fnl_lst= np.asarray( fnl_lst) # print(fnl_lst) -> (70000,)
That code result in the end in a nested numpy array which contains 70000 arrays each of them has a size of 5x50x50x3. However, I would like instead to build a 5d array with size 70000x5x50x50x3. How can I do that instead?
indare the same shape? What doesnp.vstack([read_array(o) for o in list_of_objects])produce?fnl_lst.dtype? Ifobject, then yes, there's some variation in the shapes.