Liking cljdoc? Tell your friends :D

tablecloth.pipeline

Linear pipeline operations.

Linear pipeline operations.
raw docstring

->arrayclj

(->array colname)
(->array colname datatype)

Convert numerical column(s) to java array

Convert numerical column(s) to java array
raw docstring

add-columnclj

(add-column column-name column)
(add-column column-name column size-strategy)

Add or update (modify) column under column-name.

column can be sequence of values or generator function (which gets ds as input).

  • ds - a dataset
  • column-name - if it's existing column name, column will be replaced
  • column - can be column (from other dataset), sequence, single value or function. Too big columns are always trimmed. Too small are cycled or extended with missing values (according to size-strategy argument)
  • size-strategy (optional) - when new column is shorter than dataset row count, following strategies are applied:
    • :cycle - repeat data
    • :na - append missing values
    • :strict - (default) throws an exception when sizes mismatch
Add or update (modify) column under `column-name`.

`column` can be sequence of values or generator function (which gets `ds` as input).

* `ds` - a dataset
* `column-name` - if it's existing column name, column will be replaced
* `column` - can be column (from other dataset), sequence, single value or function. Too big columns are always trimmed. Too small are cycled or extended with missing values (according to `size-strategy` argument)
* `size-strategy` (optional) - when new column is shorter than dataset row count, following strategies are applied:
  - `:cycle` - repeat data
  - `:na` - append missing values
  - `:strict` - (default) throws an exception when sizes mismatch
raw docstring

add-columnsclj

(add-columns columns-map)
(add-columns columns-map size-strategy)

Add or updade (modify) columns defined in columns-map (mapping: name -> column)

Add or updade (modify) columns defined in `columns-map` (mapping: name -> column) 
raw docstring

add-or-replace-columnclj

(add-or-replace-column column-name column)
(add-or-replace-column column-name column size-strategy)

add-or-replace-columnsclj

(add-or-replace-columns columns-map)
(add-or-replace-columns columns-map size-strategy)

aggregateclj

(aggregate aggregator)
(aggregate aggregator options)

Aggregate dataset by providing:

  • aggregation function
  • map with column names and functions
  • sequence of aggregation functions

Aggregation functions can return:

  • single value
  • seq of values
  • map of values with column names
Aggregate dataset by providing:

- aggregation function
- map with column names and functions
- sequence of aggregation functions

Aggregation functions can return:
- single value
- seq of values
- map of values with column names
raw docstring

aggregate-columnsclj

(aggregate-columns columns-selector column-aggregators)
(aggregate-columns columns-selector column-aggregators options)

Aggregates each column separately

Aggregates each column separately
raw docstring

anti-joinclj

(anti-join ds-right columns-selector)
(anti-join ds-right columns-selector options)

appendclj

(append & datasets)

as-regular-datasetclj

(as-regular-dataset)

Remove grouping tag

Remove grouping tag
raw docstring

asof-joinclj

(asof-join ds-right colname)
(asof-join ds-right colname options)

bindclj

(bind & datasets)

build-pipelined-functioncljmacro

(build-pipelined-function f m)

by-rankclj

(by-rank columns-selector rank-predicate)
(by-rank columns-selector rank-predicate 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
raw docstring

cloneclj

(clone)

Clone an object. Can clone anything convertible to a reader.

Clone an object.  Can clone anything convertible to a reader.
raw docstring

columnclj

(column colname)

column-countclj

(column-count)

column-namesclj

(column-names)
(column-names columns-selector)
(column-names columns-selector meta-field)

columnsclj

(columns)
(columns result-type)

Returns columns of dataset. Result type can be any of:

  • :as-map
  • :as-double-arrays
  • :as-seqs
Returns columns of dataset. Result type can be any of:
* `:as-map`
* `:as-double-arrays`
* `:as-seqs`
raw docstring

concatclj

(concat & datasets)

concat-copyingclj

(concat-copying & datasets)

convert-typesclj

(convert-types coltype-map-or-columns-selector)
(convert-types columns-selector new-types)

Convert type of the column to the other type.

Convert type of the column to the other type.
raw docstring

dataset->strclj

(dataset->str)
(dataset->str options)

Convert a dataset to a string. Prints a single line header and then calls dataset-data->str.

For options documentation see dataset-data->str.

Convert a dataset to a string.  Prints a single line header and then calls
dataset-data->str.

For options documentation see dataset-data->str.
raw docstring

dataset-nameclj

(dataset-name)

dataset?clj

(dataset?)

Is ds a dataset type?

Is `ds` a `dataset` type?
raw docstring

differenceclj

(difference ds-right)
(difference ds-right options)

dropclj

(drop columns-selector rows-selector)

Drop columns and rows.

Drop columns and rows.
raw docstring

drop-columnsclj

(drop-columns)
(drop-columns columns-selector)
(drop-columns columns-selector meta-field)

Drop columns by (returns dataset):

  • name
  • sequence of names
  • map of names with new names (rename)
  • function which filter names (via column metadata)
Drop columns by (returns dataset):

- name
- sequence of names
- map of names with new names (rename)
- function which filter names (via column metadata)
raw docstring

drop-missingclj

(drop-missing)
(drop-missing columns-selector)

Drop rows with missing values

columns-selector selects columns to look at missing values

Drop rows with missing values

`columns-selector` selects columns to look at missing values
raw docstring

drop-rowsclj

(drop-rows)
(drop-rows rows-selector)
(drop-rows rows-selector 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
raw docstring

empty-ds?clj

(empty-ds?)

fill-range-replaceclj

(fill-range-replace colname max-span)
(fill-range-replace colname max-span missing-strategy)
(fill-range-replace colname max-span missing-strategy missing-value)

firstclj

(first)

fold-byclj

(fold-by columns-selector)
(fold-by columns-selector folding-function)

full-joinclj

(full-join ds-right columns-selector)
(full-join ds-right columns-selector options)

group-byclj

(group-by grouping-selector)
(group-by grouping-selector options)

Group dataset by:

  • column name
  • list of columns
  • map of keys and row indexes
  • function getting map of values

Options are:

  • select-keys - when grouping is done by function, you can limit fields to a select-keys seq.
  • result-type - return results as dataset (:as-dataset, default) or as map of datasets (:as-map) or as map of row indexes (:as-indexes) or as sequence of (sub)datasets
  • other parameters which are passed to dataset fn

When dataset is returned, meta contains :grouped? set to true. Columns in dataset:

  • name - group name
  • group-id - id of the group (int)
  • data - group as dataset
Group dataset by:

- column name
- list of columns
- map of keys and row indexes
- function getting map of values

Options are:

- select-keys - when grouping is done by function, you can limit fields to a `select-keys` seq.
- result-type - return results as dataset (`:as-dataset`, default) or as map of datasets (`:as-map`) or as map of row indexes (`:as-indexes`) or as sequence of (sub)datasets
- other parameters which are passed to `dataset` fn

When dataset is returned, meta contains `:grouped?` set to true. Columns in dataset:

- name - group name
- group-id - id of the group (int)
- data - group as dataset
raw docstring

grouped?clj

(grouped?)

Is dataset represents grouped dataset (result of group-by)?

Is `dataset` represents grouped dataset (result of `group-by`)?
raw docstring

groups->mapclj

(groups->map)

Convert grouped dataset to the map of groups

Convert grouped dataset to the map of groups
raw docstring

groups->seqclj

(groups->seq)

has-column?clj

(has-column? column-name)

(head)
(head n)

infoclj

(info)
(info result-type)

inner-joinclj

(inner-join ds-right columns-selector)
(inner-join ds-right columns-selector options)

intersectclj

(intersect ds-right)
(intersect ds-right options)

join-columnsclj

(join-columns target-column columns-selector)
(join-columns target-column columns-selector options)

lastclj

(last)

left-joinclj

(left-join ds-right columns-selector)
(left-join ds-right columns-selector options)

map-columnsclj

(map-columns column-name map-fn)
(map-columns column-name columns-selector map-fn)
(map-columns column-name new-type columns-selector map-fn)

mark-as-groupclj

(mark-as-group)

Add grouping tag

Add grouping tag
raw docstring

order-byclj

(order-by columns-or-fn)
(order-by columns-or-fn comparators)
(order-by columns-or-fn comparators options)

Order dataset by:

  • column name
  • columns (as sequence of names)
  • key-fn
  • sequence of columns / key-fn Additionally you can ask the order by:
  • :asc
  • :desc
  • custom comparator function
Order dataset by:
- column name
- columns (as sequence of names)
- key-fn
- sequence of columns / key-fn
Additionally you can ask the order by:
- :asc
- :desc
- custom comparator function
raw docstring

pivot->longerclj

(pivot->longer)
(pivot->longer columns-selector)
(pivot->longer columns-selector options)

tidyr pivot_longer api

`tidyr` pivot_longer api
raw docstring

pivot->widerclj

(pivot->wider columns-selector value-columns)
(pivot->wider columns-selector value-columns options)

(print-dataset)
(print-dataset options)

process-all-api-symbolscljmacro

(process-all-api-symbols)

process-group-dataclj

(process-group-data f)
(process-group-data f parallel?)

rand-nthclj

(rand-nth)
(rand-nth options)

randomclj

(random)
(random n)
(random n options)

read-nippyclj

(read-nippy)

rename-columnsclj

(rename-columns columns-mapping)
(rename-columns columns-selector columns-map-fn)

Rename columns with provided old -> new name map

Rename columns with provided old -> new name map
raw docstring

reorder-columnsclj

(reorder-columns columns-selector & columns-selectors)

Reorder columns using column selector(s). When column names are incomplete, the missing will be attached at the end.

Reorder columns using column selector(s). When column names are incomplete, the missing will be attached at the end.
raw docstring

replace-missingclj

(replace-missing)
(replace-missing strategy)
(replace-missing columns-selector strategy)
(replace-missing columns-selector strategy value)

right-joinclj

(right-join ds-right columns-selector)
(right-join ds-right columns-selector options)

row-countclj

(row-count)

rowsclj

(rows)
(rows result-type)

Returns rows of dataset. Result type can be any of:

  • :as-maps
  • :as-double-arrays
  • :as-seqs
Returns rows of dataset. Result type can be any of:
* `:as-maps`
* `:as-double-arrays`
* `:as-seqs`
raw docstring

selectclj

(select columns-selector rows-selector)

Select columns and rows.

Select columns and rows.
raw docstring

select-columnsclj

(select-columns)
(select-columns columns-selector)
(select-columns columns-selector meta-field)

Select columns by (returns dataset):

  • name
  • sequence of names
  • map of names with new names (rename)
  • function which filter names (via column metadata)
Select columns by (returns dataset):

- name
- sequence of names
- map of names with new names (rename)
- function which filter names (via column metadata)
raw docstring

select-missingclj

(select-missing)
(select-missing columns-selector)

Select rows with missing values

columns-selector selects columns to look at missing values

Select rows with missing values

`columns-selector` selects columns to look at missing values
raw docstring

select-rowsclj

(select-rows)
(select-rows rows-selector)
(select-rows rows-selector 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
raw docstring

semi-joinclj

(semi-join ds-right columns-selector)
(semi-join ds-right columns-selector options)

separate-columnclj

(separate-column column separator)
(separate-column column target-columns separator)
(separate-column column target-columns separator options)

set-dataset-nameclj

(set-dataset-name ds-name)

shapeclj

(shape)

Returns shape of the dataset [rows, cols]

Returns shape of the dataset [rows, cols]
raw docstring

shuffleclj

(shuffle)
(shuffle options)

splitclj

(split)
(split split-type)
(split split-type options)

Split given dataset into 2 or more (holdout) splits

As the result two new columns are added:

  • :$split-name - with subgroup name
  • :$split-id - fold id/repetition id

split-type can be one of the following:

  • :kfold - k-fold strategy, :k defines number of folds (defaults to 5), produces k splits
  • :bootstrap - :ratio defines ratio of observations put into result (defaults to 1.0), produces 1 split
  • :holdout - split into two parts with given ratio (defaults to 2/3), produces 1 split
  • :loo - leave one out, produces the same number of splits as number of observations

:holdout can accept also probabilites or ratios and can split to more than 2 subdatasets

Additionally you can provide:

  • :seed - for random number generator
  • :repeats - repeat procedure :repeats times
  • :partition-selector - same as in group-by for stratified splitting to reflect dataset structure in splits.
  • :split-names names of subdatasets different than default, ie. [:train :test :split-2 ...]
  • :split-col-name - a column where name of split is stored, either :train or :test values (default: :$split-name)
  • :split-id-col-name - a column where id of the train/test pair is stored (default: :$split-id)

Rows are shuffled before splitting.

In case of grouped dataset each group is processed separately.

See more

Split given dataset into 2 or more (holdout) splits

As the result two new columns are added:

* `:$split-name` - with subgroup name
* `:$split-id` - fold id/repetition id

`split-type` can be one of the following:

* `:kfold` - k-fold strategy, `:k` defines number of folds (defaults to `5`), produces `k` splits
* `:bootstrap` - `:ratio` defines ratio of observations put into result (defaults to `1.0`), produces `1` split
* `:holdout` - split into two parts with given ratio (defaults to `2/3`), produces `1` split
* `:loo` - leave one out, produces the same number of splits as number of observations

`:holdout` can accept also probabilites or ratios and can split to more than 2 subdatasets

Additionally you can provide:

* `:seed` - for random number generator
* `:repeats` - repeat procedure `:repeats` times
* `:partition-selector` - same as in `group-by` for stratified splitting to reflect dataset structure in splits.
* `:split-names` names of subdatasets different than default, ie. `[:train :test :split-2 ...]`
* `:split-col-name` - a column where name of split is stored, either `:train` or `:test` values (default: `:$split-name`)
* `:split-id-col-name` - a column where id of the train/test pair is stored (default: `:$split-id`)

Rows are shuffled before splitting.

In case of grouped dataset each group is processed separately.

See [more](https://www.mitpressjournals.org/doi/pdf/10.1162/EVCO_a_00069)
raw docstring

split->seqclj

(split->seq)
(split->seq split-type)
(split->seq split-type options)

Returns split as a sequence of train/test datasets or map of sequences (grouped dataset)

Returns split as a sequence of train/test datasets or map of sequences (grouped dataset)
raw docstring

tailclj

(tail)
(tail n)

ungroupclj

(ungroup)
(ungroup options)

Concat groups into dataset.

When add-group-as-column or add-group-id-as-column is set to true or name(s), columns with group name(s) or group id is added to the result.

Before joining the groups groups can be sorted by group name.

Concat groups into dataset.

When `add-group-as-column` or `add-group-id-as-column` is set to `true` or name(s), columns with group name(s) or group id is added to the result.

Before joining the groups groups can be sorted by group name.
raw docstring

unionclj

(union & datasets)

unique-byclj

(unique-by)
(unique-by columns-selector)
(unique-by columns-selector options)

unmark-groupclj

(unmark-group)

Remove grouping tag

Remove grouping tag
raw docstring

unrollclj

(unroll columns-selector)
(unroll columns-selector options)

update-columnsclj

(update-columns columns-map)
(update-columns columns-selector update-functions)

write!clj

(write! output-path)
(write! output-path options)

Write a dataset out to a file. Supported forms are:

(ds/write! test-ds "test.csv")
(ds/write! test-ds "test.tsv")
(ds/write! test-ds "test.tsv.gz")
(ds/write! test-ds "test.nippy")
(ds/write! test-ds out-stream)

Options:

  • :max-chars-per-column - csv,tsv specific, defaults to 65536 - values longer than this will cause an exception during serialization.
  • :max-num-columns - csv,tsv specific, defaults to 8192 - If the dataset has more than this number of columns an exception will be thrown during serialization.
  • :quoted-columns - csv specific - sequence of columns names that you would like to always have quoted.
  • :file-type - Manually specify the file type. This is usually inferred from the filename but if you pass in an output stream then you will need to specify the file type.
  • :headers? - if csv headers are written, defaults to true.
Write a dataset out to a file.  Supported forms are:

```clojure
(ds/write! test-ds "test.csv")
(ds/write! test-ds "test.tsv")
(ds/write! test-ds "test.tsv.gz")
(ds/write! test-ds "test.nippy")
(ds/write! test-ds out-stream)
```

Options:

  * `:max-chars-per-column` - csv,tsv specific, defaults to 65536 - values longer than this will
     cause an exception during serialization.
  * `:max-num-columns` - csv,tsv specific, defaults to 8192 - If the dataset has more than this number of
     columns an exception will be thrown during serialization.
  * `:quoted-columns` - csv specific - sequence of columns names that you would like to always have quoted.
  * `:file-type` - Manually specify the file type.  This is usually inferred from the filename but if you
     pass in an output stream then you will need to specify the file type.
  * `:headers?` - if csv headers are written, defaults to true.
raw docstring

write-nippy!clj

(write-nippy! filename)

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

× close