# Can't use sort help, Here is code

**URL:** <https://discourse.julialang.org/t/cant-use-sort-help-here-is-code/57517>\
**Category:** New to Julia\
**Created:** [March 19, 2021, 6:31am UTC](https://discourse.julialang.org/t/cant-use-sort-help-here-is-code/57517 "2021-03-19T06:31:45Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nitish\_Dubey](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nitish_dubey/32/9092_2.png) [@Nitish\_Dubey](https://discourse.julialang.org/u/Nitish_Dubey)\
**Post date:** [March 19, 2021, 6:31am UTC](https://discourse.julialang.org/t/cant-use-sort-help-here-is-code/57517/1 "2021-03-19T06:31:45Z")

</div>

```julia
 a = [7 0 4 6 2 3 9]
1×7 Array{Int64,2}:
 7 0 4 6 2 3 9

julia> sort(a)
ERROR: UndefKeywordError: keyword argument dims not assigned
Stacktrace:
 [1] sort(::Array{Int64,2}) at .\sort.jl:1045
 [2] top-level scope at REPL[2]:1

julia> sort!(a)
ERROR: UndefKeywordError: keyword argument dims not assigned
Stacktrace:
 [1] sort!(::Array{Int64,2}) at .\sort.jl:1105
 [2] top-level scope at REPL[3]:1

julia> sort!(a,dims = 1)
1×7 Array{Int64,2}:
 7 0 4 6 2 3 9

```

---

<div class="post-metadata">

**Author:** ![nilshg](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/nilshg/32/2283_2.png) [@nilshg](https://discourse.julialang.org/u/nilshg)\
**Post date:** [March 19, 2021, 6:48am UTC](https://discourse.julialang.org/t/cant-use-sort-help-here-is-code/57517/2 "2021-03-19T06:48:23Z")

</div>

Are you looking for

```julia
julia> a = [7 0 4 6 2 3 9]
1×7 Matrix{Int64}:
 7 0 4 6 2 3 9

julia> sort!(a, dims = 2)
1×7 Matrix{Int64}:
 0 2 3 4 6 7 9

```

Your array is `1x7` as you see, so the dimension you want to sort along is the second.

---

<div class="post-metadata">

**Author:** ![JeffreySarnoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/jeffreysarnoff/32/1980_2.png) [@JeffreySarnoff](https://discourse.julialang.org/u/JeffreySarnoff)\
**Post date:** [March 19, 2021, 6:48am UTC](https://discourse.julialang.org/t/cant-use-sort-help-here-is-code/57517/3 "2021-03-19T06:48:46Z")

</div>

Hi – you should use commas

```julia
julia> b = [7, 0, 4, 6, 2, 3, 9]
julia> sort(b)

```

In Julia, the usual vector is a column vector, and row vectors (what you get when there is a space between numbers rather than a comma) are as @nilshg said.
