# Permutedims not working correctly with NamedArray where names are symbols

**URL:** <https://discourse.julialang.org/t/permutedims-not-working-correctly-with-namedarray-where-names-are-symbols/97014>\
**Category:** General Usage\
**Created:** [April 3, 2023, 2:19pm UTC](https://discourse.julialang.org/t/permutedims-not-working-correctly-with-namedarray-where-names-are-symbols/97014 "2023-04-03T14:19:40Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mitch\_Phillipson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mitch_phillipson/32/42883_2.png) [@Mitch\_Phillipson](https://discourse.julialang.org/u/Mitch_Phillipson)\
**Post date:** [April 3, 2023, 2:19pm UTC](https://discourse.julialang.org/t/permutedims-not-working-correctly-with-namedarray-where-names-are-symbols/97014/1 "2023-04-03T14:19:40Z")

</div>

I’m trying to permute the dimensions of a NamedArray where the names are symbols. However, I’m getting “Method Error: Cannot `convert` an object of type String to an object of type Symbol”

Here is an example of the code I’m using

```julia
using NamedArrays

A = NamedArray([1 2 3;4 5 6],([:a,:b],[:c,:d,:e]))
permutedims(A,(2,1))

```

This error does not arise if the names are strings or if the size of each dimension matches, e.g. the following work:

```julia
using NamedArrays

A = NamedArray([1 2 3;4 5 6],(["a","b"],["c","d","e"]))
permutedims(A,(2,1))

B = NamedArray([1 2;4 5],([:a,:b],[:c,:d]))
permutedims(B,(2,1))

```

Any advice on how to solve this issue?

\*edit: transpose does work in this case, but in general my structures are \>2 dimensional

---

<div class="post-metadata">

**Author:** ![Mitch\_Phillipson](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mitch_phillipson/32/42883_2.png) [@Mitch\_Phillipson](https://discourse.julialang.org/u/Mitch_Phillipson)\
**Post date:** [April 3, 2023, 2:39pm UTC](https://discourse.julialang.org/t/permutedims-not-working-correctly-with-namedarray-where-names-are-symbols/97014/2 "2023-04-03T14:39:35Z")

</div>

To future generations searching and finding this topic, I’ve solved the issue.

```julia
using NamedArrays

A = NamedArray([1 2 3;4 5 6],([:a,:b],[:c,:d,:e]))
permutedims(A, [2,1] ) #Permutation should be a vector

```

I’m going to raise an issue on the NamedArrays github to add support for tuples.
