Sep-25-2019, 08:47 AM
Hi!
I'm dealing with huge data and I'm looking for an efficient way to reshape my list of arrays. Here is my solution which I find to be slow
Thank you for your help.
I'm dealing with huge data and I'm looking for an efficient way to reshape my list of arrays. Here is my solution which I find to be slow
#x is an input of shape [file,measurement, array(n,r)], i.e. #len(x) returns file #len(x[0]) returns measurement #x[0][0].shape returns (n,r)the output I require:
#new_x is a list of arrays, its shape is [file*measurement*n, array(r)]I'm using the following code:
new_x=[] for ii in range(len(x)): for jj in range(len(x[0])): for kk in range(len(x[0][0])): new_x.append(x[ii][jj][kk])Is there a more efficient way?
Thank you for your help.