Liking cljdoc? Tell your friends :D

tablecloth.api.rows


by-rankclj

(by-rank ds columns-selector rank-predicate)
(by-rank ds
         columns-selector
         rank-predicate
         {:keys [desc? ties] :or {desc? true ties :dense} :as options})

Select rows using rank on a column, ties are resolved using :dense method.

See R docs. Rank uses 0 based indexing.

Possible :ties strategies: :average, :first, :last, :random, :min, :max, :dense. :dense is the same as in data.table::frank from R

:desc? set to true (default) order descending before calculating rank

Select rows using `rank` on a column, ties are resolved using `:dense` method.

See [R docs](https://www.rdocumentation.org/packages/base/versions/3.6.1/topics/rank).
Rank uses 0 based indexing.

Possible `:ties` strategies: `:average`, `:first`, `:last`, `:random`, `:min`, `:max`, `:dense`.
`:dense` is the same as in `data.table::frank` from R

`:desc?` set to true (default) order descending before calculating rank
sourceraw docstring

drop-rowsclj

(drop-rows ds)
(drop-rows ds rows-selector)
(drop-rows ds
           rows-selector
           {:keys [select-keys pre result-type parallel?] :as options})

Drop rows using:

  • row id
  • seq of row ids
  • seq of true/false
  • fn with predicate
Drop rows using:

- row id
- seq of row ids
- seq of true/false
- fn with predicate
sourceraw docstring

firstclj

(first ds)

First row

First row
sourceraw docstring

(head ds)
(head ds n)

First n rows (default 5)

First n rows (default 5)
sourceraw docstring

lastclj

(last ds)

Last row

Last row
sourceraw docstring

map-rowsclj

(map-rows ds map-fn)
(map-rows ds map-fn options)

Map a function across the rows of the dataset producing a new dataset that is merged back into the original potentially replacing existing columns.

Map a function across the rows of the dataset producing a new dataset that is merged back into the original potentially replacing existing columns.
sourceraw docstring

rand-nthclj

(rand-nth ds)
(rand-nth ds {:keys [seed] :as options})

Returns single random row

Returns single random row
sourceraw docstring

randomclj

(random ds)
(random ds n)
(random ds n {:keys [repeat? seed] :or {repeat? true} :as options})

Returns (n) random rows with repetition

Returns (n) random rows with repetition
sourceraw docstring

select-rowsclj

(select-rows ds)
(select-rows ds rows-selector)
(select-rows ds
             rows-selector
             {:keys [select-keys pre result-type parallel?] :as options})

Select rows using:

  • row id
  • seq of row ids
  • seq of true/false
  • fn with predicate
Select rows using:

- row id
- seq of row ids
- seq of true/false
- fn with predicate
sourceraw docstring

shuffleclj

(shuffle ds)
(shuffle ds {:keys [seed] :as options})

Shuffle dataset (with seed)

Shuffle dataset (with seed)
sourceraw docstring

tailclj

(tail ds)
(tail ds n)

Last n rows (default 5)

Last n rows (default 5)
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close