(between ds col-name low high)(between ds col-selector low high {:keys [missing-default] :as options})Detect where values fall in a specified range in a numeric column. This is a shortcut for (< low x high).
(between ds col-name low high)
(between ds col-name low high {:missing-default val})
ds - A tech.ml.dataset (i.e a tablecloth dataset)column-name - Name of the column to use in the comparisonlow - Lower bound for values of column-namehigh - Upper bound for values of column-nameoptions - optional Options map containing the key missing-default to specify what value to use in the case that the value of (col-name row) is nil. Throws an error if there are any missing values in the column and this option is not provided.A dataset with only rows that contain values between low and high in column col-name
Detect where values fall in a specified range in a numeric column. This is a shortcut for `(< low x high)`.
## Usage
`(between ds col-name low high)`
`(between ds col-name low high {:missing-default val})`
## Arguments
- `ds` - A `tech.ml.dataset` (i.e a `tablecloth` dataset)
- `column-name` - Name of the column to use in the comparison
- `low` - Lower bound for values of `column-name`
- `high` - Upper bound for values of `column-name`
- `options` - __optional__ Options map containing the key `missing-default` to specify what value to use in the case that the value of (col-name row) is `nil`. Throws an error if there are any missing values in the column and this option is not provided.
## Returns
A dataset with only rows that contain values between `low` and `high` in column `col-name`(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
(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:
Drop rows using: - row id - seq of row ids - seq of true/false - fn with predicate
(duplicate-rows ds)Filter a dataset for only duplicated rows.
(duplicate-rows ds)
ds - A tech.ml.dataset (i.e a tablecloth dataset)A dataset containing only rows that are exact duplicates.
Filter a dataset for only duplicated rows. ## Usage `(duplicate-rows ds)` ## Arguments - `ds` - A `tech.ml.dataset` (i.e a `tablecloth` dataset) ## Returns A dataset containing only rows that are exact duplicates.
(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.
(rand-nth ds)(rand-nth ds {:keys [seed] :as options})Returns single random row
Returns single random row
(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
(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:
Select rows using: - row id - seq of row ids - seq of true/false - fn with predicate
(shuffle ds)(shuffle ds {:keys [seed] :as options})Shuffle dataset (with seed)
Shuffle dataset (with seed)
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |