How to swap index of a multi-dimensional array?

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).

That would be

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

2 Likes

Oh, I see, thanks!