Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,4 @@
sorttable(T; ordering=<, column=1, reverse=false) =
sort(T, by = t -> t[column], lt = reverse ? (a,b) -> ordering(b,a) : ordering)
sorttable(T, ordering=<, column=1, reverse=false) =
sorttable(T, ordering=ordering, column=column, reverse=reverse)

View file

@ -0,0 +1,17 @@
julia> data = {["a", "b", "c"], ["", "q", "z"], ["zap", "zip", "Zot"]}
3-element Array{Any,1}:
["a","b","c"]
["","q","z"]
["zap","zip","Zot"]
julia> sorttable(data, column=2, reverse=true) # named arguments
3-element Array{Any,1}:
["zap","zip","Zot"]
["","q","z"]
["a","b","c"]
julia> sorttable(data, >, 2) # the same thing, with positional arguments
3-element Array{Any,1}:
["zap","zip","Zot"]
["","q","z"]
["a","b","c"]