# Transpose not working on Array{Any,2}

**URL:** <https://discourse.julialang.org/t/transpose-not-working-on-array-any-2/6510>\
**Category:** General Usage\
**Created:** [October 17, 2017, 4:54pm UTC](https://discourse.julialang.org/t/transpose-not-working-on-array-any-2/6510 "2017-10-17T16:54:32Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Post date:** [October 17, 2017, 4:54pm UTC](https://discourse.julialang.org/t/transpose-not-working-on-array-any-2/6510/1 "2017-10-17T16:54:32Z")

</div>

transpose is not working for a specific matrix I have. Consider the last line in the code below.

Is this deliberate? am I missing anything here?

I can work around this, by using permutedims, but I would have expected transpose to work.

```julia
othermat=convert(Array{Any,2},rand(3,2))
transpose(othermat) #works

mat=Any["Correlation" 0.367298; "Std Dev Trn" 1.54907e-8; "Std Dev Val" 0.0115051;]

permutedims(mat,[2,1]) #works
permutedims(mat,(2,1)) #works

transpose(mat) #does not work on julia 0.6

```

ERROR: MethodError: no method matching transpose(::String)  
Closest candidates are:  
transpose(::BitArray{2}) at linalg\bitarray.jl:265  
transpose(::Number) at number.jl:100  
transpose(::RowVector{T,CV} where CV\<:(ConjArray{T,1,V} where V\<:(AbstractArray{T,1} where T) where T) where T) at linalg\rowvector.jl:82  
…  
Stacktrace:  
[1] transpose\_f!(::Base.#transpose, ::Array{Any,2}, ::Array{Any,2}) at .\linalg\transpose.jl:54  
[2] transpose(::Array{Any,2}) at .\linalg\transpose.jl:121

---

<div class="post-metadata">

**Author:** ![rdeits](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rdeits/32/286_2.png) [@rdeits](https://discourse.julialang.org/u/rdeits)\
**Post date:** [October 17, 2017, 5:06pm UTC](https://discourse.julialang.org/t/transpose-not-working-on-array-any-2/6510/2 "2017-10-17T17:06:10Z")

</div>

This is intentional, but controversial. See [https://github.com/JuliaLang/julia/issues/20978](https://github.com/JuliaLang/julia/issues/20978) for some discussion of whether or not it actually makes sense to get the error you’re seeing.

In the meantime, your `permutedims()` solution is perfectly good.

---

<div class="post-metadata">

**Author:** ![bernhard](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/bernhard/32/2619_2.png) [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Post date:** [October 17, 2017, 5:06pm UTC](https://discourse.julialang.org/t/transpose-not-working-on-array-any-2/6510/3 "2017-10-17T17:06:56Z")

</div>

thank you.
