Consider three different MatLab arrays: a, b and c. All of them are equally sized arrays. Let's say, 64 x 64. Now, in order to re-organize the elements of one of these arrays in form of a one-dimension vector inside another array, X, I can do the following:
X = [X a(:)];
Now, I have a 4096 x 1 array. If I want to have an array with that contains in each column the elements of different arrays, I can just repeat the process above for b and c.
Is there an equivalent of this in Python?
numpy.ndarray.flatten()andnumpy.ndarray.vstack()? And this answer has a comparison of ways to flatten a 2D array in python.[a(:), b(:), c(:)]will be (4096,3). Innumpydo you want (3, 4096) or (4096,3) array?numpyis C ordered (by default), MATLAB F ordered.