How to swap index of a multi-dimensional array?

array

#1

I have a multi-dimensional array with shape (2, 3, 4, 5, 6), how can I swap dimensions in Julia? I want to swap to (2, 4, 3, 5, 6).


#2

That would be

data = permutedims(data, [1, 3, 2, 4, 5])


#3

Oh, I see, thanks!