# Problem: extracting a row from an array, returns a column

**URL:** <https://discourse.julialang.org/t/problem-extracting-a-row-from-an-array-returns-a-column/37331>\
**Category:** General Usage\
**Tags:** question, arrays\
**Created:** [April 10, 2020, 11:33am UTC](https://discourse.julialang.org/t/problem-extracting-a-row-from-an-array-returns-a-column/37331 "2020-04-10T11:33:05Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![heliosdrm](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/heliosdrm/32/3851_2.png) [@heliosdrm](https://discourse.julialang.org/u/heliosdrm)\
**Post date:** [April 10, 2020, 12:52pm UTC](https://discourse.julialang.org/t/problem-extracting-a-row-from-an-array-returns-a-column/37331/4 "2020-04-10T12:52:30Z")

</div>

Among the different replies given in the linked discussion, I think that this one by Oscar Smith is the clearest, so perhaps it will make sense after reading it:

> [@Trouble Understanding Slicing](https://discourse.julialang.org/t/trouble-understanding-slicing/36821/8):
>
> The reason scalar indexing drops dimensions is a little more subtle than I explained initially. The idea is that A[i,:][j]=A[i,j] is an identity that feels like it should hold. Since A[i,j] is a scalar, A[i,:] needs to be a type which when indexed by 1 index gives a scalar. The fact that Julia has ND arrays makes this harder to get around since matrices aren’t consider special-- they are just Array{T,2}. The reason A[[i],:] needs to have the same type as A[[i,j],:] is for type stability. Both o…

---

_[View the full topic](https://discourse.julialang.org/t/problem-extracting-a-row-from-an-array-returns-a-column/37331)._
