Has sortrows disappeard?

Hi
Apparently there use to be a function sortrows() in julia, that sorted the rows of matrix A lexicographically.
It seems that this function has disappeared, am I wrong?

Michael.

you could write this as sort(A, dims=2). I’m not sure if sortrows used to be a function.

1 Like

Functions that have disappeared were deprecated in some version of Julia, usually 0.7. Running that version gives a helpful hint what you can do instead (not always the best solution, but a solution).

   _       _ _(_)_     |  A fresh approach to technical computing
  (_)     | (_) (_)    |  Documentation: https://docs.julialang.org
   _ _   _| |_  __ _   |  Type "?" for help, "]?" for Pkg help.
  | | | | | | |/ _` |  |
  | | |_| | | | (_| |  |  Version 0.7.0 (2018-08-08 06:46 UTC)
 _/ |\__'_|_|_|\__'_|  |  
|__/                   |  x86_64-linux-gnu

julia> sortrows(rand(2, 2))
β”Œ Warning: `sortrows(A::AbstractMatrix; kws...)` is deprecated, use `sortslices(A, dims=1, kws...)` instead.
β”‚   caller = top-level scope at none:0
β”” @ Core none:0
2Γ—2 Array{Float64,2}:
 0.135429  0.150462
 0.391157  0.297061

Note, deprecations and removals don’t happen in minor Julia 1.x releases but were somewhat frequent in the 0.x times.

2 Likes