I have an array that I would like to switch the axes order of. It is similar to a transpose except I would like to perform it on arrays with dimensions greater than 2. In Python I would use np.transpose and in Matlab, permute, but I can't seem to find this in Julia. For instance,
a = ones(2, 3, 4)
size(a)
(2,3,4)
From this I would like to get an array of shape (3, 4, 2) by rearranging the axes (dimensions) to (2, 3, 1). I am looking for a function called new_func.
b = new_func(a, (2, 3, 1))
size(b)
(3,4,2)