I'm new to python and I'm trying to convert a (m,n,1) multidimensional array to (m,n) in a fast way, how can I go about it?
Also given a (m,n,k) array how can I split it to k (m,n) arrays? (each of the k members belongs to a different array)
I'm new to python and I'm trying to convert a (m,n,1) multidimensional array to (m,n) in a fast way, how can I go about it?
Also given a (m,n,k) array how can I split it to k (m,n) arrays? (each of the k members belongs to a different array)
To reshape array a you can use a.reshape(m,n).
To split array a along the depth dimension, you can use numpy.dsplit(a, a.shape[2]).
https://docs.scipy.org/doc/numpy/reference/generated/numpy.split.html https://docs.scipy.org/doc/numpy/reference/generated/numpy.dsplit.html#numpy.dsplit