How can I change array:
np.array([[[a,b,c], [d,e,f]], [[g, h, i], [j, k, l]]])
to this format:
np.array([a,b,c,d,e,f,g,h,i,j,k,l])
How can I change array:
np.array([[[a,b,c], [d,e,f]], [[g, h, i], [j, k, l]]])
to this format:
np.array([a,b,c,d,e,f,g,h,i,j,k,l])
I guess you want to use numpy.ndarray.flatten
There is also a parameter that determines whether to flatten in row-major or column-major order or preserve the ordering.
From the docs I linked:
>>> a = np.array([[1,2], [3,4]])
>>> a.flatten()
array([1, 2, 3, 4])
>>> a.flatten('F')
array([1, 3, 2, 4])