Tablecloth API
Tablecloth API
(* ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/* to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/* to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(+ ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/+ to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/+ to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(- ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/- to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/- to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(->array ds colname)
(->array ds colname datatype)
Convert numerical column(s) to java array
Convert numerical column(s) to java array
(/ ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators// to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators// to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(< ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/< to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 3 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/< to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 3 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(<= ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/<= to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 3 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/<= to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 3 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(> ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/> to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 3 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/> to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 3 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(>= ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/>= to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 3 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/>= to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 3 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(abs ds target-col columns-selector)
(abs ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/abs to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/abs to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(acos ds target-col columns-selector)
(acos ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/acos to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/acos to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(add-column ds column-name column)
(add-column ds 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 datasetcolumn-name
- if it's existing column name, column will be replacedcolumn
- can be column (from other dataset), sequence, single value or function (taking a dataset). 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 mismatchAdd 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 (taking a dataset). 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-columns ds columns-map)
(add-columns ds 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)
(add-or-replace-column ds column-name column)
(add-or-replace-column ds column-name column size-strategy)
(add-or-replace-columns ds columns-map)
(add-or-replace-columns ds columns-map size-strategy)
(aggregate ds aggregator)
(aggregate ds
aggregator
{:keys [default-column-name-prefix ungroup? parallel?]
:or {default-column-name-prefix "summary" ungroup? true}
:as options})
Aggregate dataset by providing:
Aggregation functions can return:
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-columns ds columns-aggregators)
(aggregate-columns ds columns-selector column-aggregators)
(aggregate-columns ds columns-selector column-aggregators options)
Aggregates each column separately
Aggregates each column separately
(and ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/and to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 2 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/and to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 2 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(anti-join ds-left ds-right columns-selector)
(anti-join ds-left ds-right columns-selector options)
(append ds & datasets)
Concats columns of several datasets
Concats columns of several datasets
(array-column->columns ds src-column)
(array-column->columns ds src-column opts)
Converts a column of type java array into several columns, one for each element of the array of all rows. The source column is dropped afterwards. The function assumes that arrays in all rows have same type and length and are numeric.
ds
Datset to operate on.
src-column
The (array) column to convert
opts
can contain:
prefix
newly created column will get prefix before column number
Converts a column of type java array into several columns, one for each element of the array of all rows. The source column is dropped afterwards. The function assumes that arrays in all rows have same type and length and are numeric. `ds` Datset to operate on. `src-column` The (array) column to convert `opts` can contain: `prefix` newly created column will get prefix before column number
(as-regular-dataset ds)
Remove grouping tag
Remove grouping tag
(asin ds target-col columns-selector)
(asin ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/asin to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/asin to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(asof-join ds-left ds-right columns-selector)
(asof-join ds-left ds-right columns-selector options)
(atan ds target-col columns-selector)
(atan ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/atan to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/atan to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(atan2 ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/atan2 to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/atan2 to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(bit-and ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/bit-and to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/bit-and to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(bit-and-not ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/bit-and-not to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/bit-and-not to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(bit-clear ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/bit-clear to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/bit-clear to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(bit-flip ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/bit-flip to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/bit-flip to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(bit-not ds target-col columns-selector)
(bit-not ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/bit-not to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/bit-not to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(bit-or ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/bit-or to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/bit-or to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(bit-set ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/bit-set to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/bit-set to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(bit-shift-left ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/bit-shift-left to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/bit-shift-left to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(bit-shift-right ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/bit-shift-right to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/bit-shift-right to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(bit-xor ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/bit-xor to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/bit-xor to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(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
(cbrt ds target-col columns-selector)
(cbrt ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/cbrt to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/cbrt to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(ceil ds target-col columns-selector)
(ceil ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/ceil to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/ceil to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(clone item)
Clone an object. Can clone anything convertible to a reader.
Clone an object. Can clone anything convertible to a reader.
(column-names ds)
(column-names ds columns-selector)
(column-names ds columns-selector meta-field)
Returns column names, given a selector. Columns-selector can be one of the following:
Column name can be anything.
column-names function returns names according to columns-selector and optional meta-field. meta-field is one of the following:
:name
(default) - to operate on column names:datatype
- to operated on column types:all
- if you want to process all metadataDatatype groups are:
:type/numerical
- any numerical type:type/float
- floating point number (:float32 and :float64):type/integer
- any integer:type/datetime
- any datetime typeIf qualified keyword starts with :!type, complement set is used.
Returns column names, given a selector. Columns-selector can be one of the following: * :all keyword - selects all columns * column name - for single column * sequence of column names - for collection of columns * regex - to apply pattern on column names or datatype * filter predicate - to filter column names or datatype * type namespaced keyword for specific datatype or group of datatypes Column name can be anything. column-names function returns names according to columns-selector and optional meta-field. meta-field is one of the following: * `:name` (default) - to operate on column names * `:datatype` - to operated on column types * `:all` - if you want to process all metadata Datatype groups are: * `:type/numerical` - any numerical type * `:type/float` - floating point number (:float32 and :float64) * `:type/integer` - any integer * `:type/datetime` - any datetime type If qualified keyword starts with :!type, complement set is used.
(columns ds)
(columns ds 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`
(columns->array-column ds column-selector new-column)
Converts several columns to a single column of type array. The src columns are dropped afterwards.
ds
Dataset to operate on.
column-selector
anything supported by select-columns
new-column
new column to create
Converts several columns to a single column of type array. The src columns are dropped afterwards. `ds` Dataset to operate on. `column-selector` anything supported by [[select-columns]] `new-column` new column to create
(complete ds columns-selector & r)
TidyR complete.
Fills a dataset with all possible combinations of selected columns. When a given combination doesn't exist, missing values are created.
TidyR complete. Fills a dataset with all possible combinations of selected columns. When a given combination doesn't exist, missing values are created.
(concat dataset & datasets)
Joins rows from other datasets
Joins rows from other datasets
(concat-copying dataset & datasets)
Joins rows from other datasets via a copy of data
Joins rows from other datasets via a copy of data
(convert-types ds coltype-map-or-columns-selector)
(convert-types ds columns-selector new-types)
Convert type of the column to the other type.
Convert type of the column to the other type.
(cos ds target-col columns-selector)
(cos ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/cos to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/cos to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(cosh ds target-col columns-selector)
(cosh ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/cosh to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/cosh to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(cross-join ds-left ds-right)
(cross-join ds-left ds-right columns-selector)
(cross-join ds-left
ds-right
columns-selector
{:keys [unique?] :or {unique? false} :as options})
Cross product from selected columns
Cross product from selected columns
(crosstab ds row-selector col-selector)
(crosstab ds row-selector col-selector options)
Cross tabulation of two sets of columns.
Creates grouped dataset by [row-selector, col-selector] pairs and calls aggregation on each group.
Options:
Cross tabulation of two sets of columns. Creates grouped dataset by [row-selector, col-selector] pairs and calls aggregation on each group. Options: * pivot? - create pivot table or just flat structure (default: true) * replace-missing? - replace missing values? (default: true) * missing-value - a missing value (default: 0) * aggregator - aggregating function (default: row-count) * marginal-rows, marginal-cols - adds row and/or cols, it's a sum if true. Can be a custom fn.
(cummax ds target-col columns-selector)
(cummax ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/cummax to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/cummax to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(cummin ds target-col columns-selector)
(cummin ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/cummin to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/cummin to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(cumprod ds target-col columns-selector)
(cumprod ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/cumprod to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/cumprod to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(cumsum ds target-col columns-selector)
(cumsum ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/cumsum to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/cumsum to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(dataset)
(dataset data)
(dataset data
{:keys [single-value-column-name column-names layout dataset-name
stack-trace? error-column?]
:or {single-value-column-name :$value
layout :as-rows
stack-trace? false
error-column? true}
:as options})
Create a dataset
.
Dataset can be created from:
Single value is set only when it's not possible to find a path for given data. If tech.ml.dataset throws an exception, it's won;t be printed. To print a stack trace, set stack-trace?
option to true
.
ds/->dataset documentation:
Create a dataset from either csv/tsv or a sequence of maps.
A String
be interpreted as a file (or gzipped file if it
ends with .gz) of tsv or csv data. The system will attempt to autodetect if this
is csv or tsv and then engineering around detecting datatypes all of which can
be overridden.
InputStreams have no file type and thus a file-type
must be provided in the
options.
A sequence of maps may be passed in in which case the first N maps are scanned in order to derive the column datatypes before the actual columns are created.
Parquet, xlsx, and xls formats require that you require the appropriate libraries
which are tech.v3.libs.parquet
for parquet, tech.v3.libs.fastexcel
for xlsx,
and tech.v3.libs.poi
for xls.
Arrow support is provided via the tech.v3.libs.Arrow namespace not via a file-type
overload as the Arrow project current has 3 different file types and it is not clear
what their final suffix will be or which of the three file types it will indicate.
Please see documentation in the tech.v3.libs.arrow
namespace for further information
on Arrow file types.
Options:
:dataset-name
- set the name of the dataset.
:file-type
- Override filetype discovery mechanism for strings or force a particular
parser for an input stream. Note that parquet must have paths on disk
and cannot currently load from input stream. Acceptible file types are:
#{:csv :tsv :xlsx :xls :parquet}.
:gzipped?
- for file formats that support it, override autodetection and force
creation of a gzipped input stream as opposed to a normal input stream.
:column-allowlist
- either sequence of string column names or sequence of column
indices of columns to allowlist. This is preferred to :column-whitelist
:column-blocklist
- either sequence of string column names or sequence of column
indices of columns to blocklist. This is preferred to :column-blacklist
:num-rows
- Number of rows to read
:header-row?
- Defaults to true, indicates the first row is a header.
:key-fn
- function to be applied to column names. Typical use is:
:key-fn keyword
.
:separator
- Add a character separator to the list of separators to auto-detect.
:csv-parser
- Implementation of univocity's AbstractParser to use. If not
provided a default permissive parser is used. This way you parse anything that
univocity supports (so flat files and such).
:bad-row-policy
- One of three options: :skip, :error, :carry-on. Defaults to
:carry-on. Some csv data has ragged rows and in this case we have several
options. If the option is :carry-on then we either create a new column or add
missing values for columns that had no data for that row.
:skip-bad-rows?
- Legacy option. Use :bad-row-policy.
:disable-comment-skipping?
- As default, the #
character is recognised as a
line comment when found in the beginning of a line of text in a CSV file,
and the row will be ignored. Set true
to disable this behavior.
:max-chars-per-column
- Defaults to 4096. Columns with more characters that this
will result in an exception.
:max-num-columns
- Defaults to 8192. CSV,TSV files with more columns than this
will fail to parse. For more information on this option, please visit:
https://github.com/uniVocity/univocity-parsers/issues/301
:text-temp-dir
- The temporary directory to use for file-backed text. Setting
this value to boolean 'false' turns off file backed text which is the default. If a
tech.v3.resource stack context is opened the file will be deleted when the context
closes else it will be deleted when the gc cleans up the dataset. A shutdown hook is
added as a last resort to ensure the file is cleaned up.
:n-initial-skip-rows
- Skip N rows initially. This currently may include the
header row. Works across both csv and spreadsheet datasets.
:parser-type
- Default parser to use if no parser-fn is specified for that column.
For csv files, the default parser type is :string
which indicates a promotional
string parser. For sequences of maps, the default parser type is :object. It can
be useful in some contexts to use the :string
parser with sequences of maps or
maps of columns.
:parser-fn
-
keyword?
- all columns parsed to this datatype. For example:
{:parser-fn :string}
map?
- {column-name parse-method}
parse each column with specified
parse-method
.
The parse-method
can be:
keyword?
- parse the specified column to this datatype. For example:
{:parser-fn {:answer :boolean :id :int32}}
[datatype parse-data]
in which case container of type
[datatype]
will be created. parse-data
can be one of:
:relaxed?
- data will be parsed such that parse failures of the standard
parse functions do not stop the parsing process. :unparsed-values and
:unparsed-indexes are available in the metadata of the column that tell
you the values that failed to parse and their respective indexes.fn?
- function from str-> one of :tech.v3.dataset/missing
,
:tech.v3.dataset/parse-failure
, or the parsed value.
Exceptions here always kill the parse process. :missing will get marked
in the missing indexes, and :parse-failure will result in the index being
added to missing, the unparsed the column's :unparsed-values and
:unparsed-indexes will be updated.string?
- for datetime types, this will turned into a DateTimeFormatter via
DateTimeFormatter/ofPattern. For :text
you can specify the backing file
to use.DateTimeFormatter
- use with the appropriate temporal parse static function
to parse the value.map?
- the header-name-or-idx is used to lookup value. If not nil, then
value can be any of the above options. Else the default column parser
is used.
Returns a new dataset
Create a `dataset`. Dataset can be created from: * map of values and/or sequences * sequence of maps * sequence of columns * file or url * array of arrays * single value Single value is set only when it's not possible to find a path for given data. If tech.ml.dataset throws an exception, it's won;t be printed. To print a stack trace, set `stack-trace?` option to `true`. ds/->dataset documentation: Create a dataset from either csv/tsv or a sequence of maps. * A `String` be interpreted as a file (or gzipped file if it ends with .gz) of tsv or csv data. The system will attempt to autodetect if this is csv or tsv and then engineering around detecting datatypes all of which can be overridden. * InputStreams have no file type and thus a `file-type` must be provided in the options. * A sequence of maps may be passed in in which case the first N maps are scanned in order to derive the column datatypes before the actual columns are created. Parquet, xlsx, and xls formats require that you require the appropriate libraries which are `tech.v3.libs.parquet` for parquet, `tech.v3.libs.fastexcel` for xlsx, and `tech.v3.libs.poi` for xls. Arrow support is provided via the tech.v3.libs.Arrow namespace not via a file-type overload as the Arrow project current has 3 different file types and it is not clear what their final suffix will be or which of the three file types it will indicate. Please see documentation in the `tech.v3.libs.arrow` namespace for further information on Arrow file types. Options: - `:dataset-name` - set the name of the dataset. - `:file-type` - Override filetype discovery mechanism for strings or force a particular parser for an input stream. Note that parquet must have paths on disk and cannot currently load from input stream. Acceptible file types are: #{:csv :tsv :xlsx :xls :parquet}. - `:gzipped?` - for file formats that support it, override autodetection and force creation of a gzipped input stream as opposed to a normal input stream. - `:column-allowlist` - either sequence of string column names or sequence of column indices of columns to allowlist. This is preferred to `:column-whitelist` - `:column-blocklist` - either sequence of string column names or sequence of column indices of columns to blocklist. This is preferred to `:column-blacklist` - `:num-rows` - Number of rows to read - `:header-row?` - Defaults to true, indicates the first row is a header. - `:key-fn` - function to be applied to column names. Typical use is: `:key-fn keyword`. - `:separator` - Add a character separator to the list of separators to auto-detect. - `:csv-parser` - Implementation of univocity's AbstractParser to use. If not provided a default permissive parser is used. This way you parse anything that univocity supports (so flat files and such). - `:bad-row-policy` - One of three options: :skip, :error, :carry-on. Defaults to :carry-on. Some csv data has ragged rows and in this case we have several options. If the option is :carry-on then we either create a new column or add missing values for columns that had no data for that row. - `:skip-bad-rows?` - Legacy option. Use :bad-row-policy. - `:disable-comment-skipping?` - As default, the `#` character is recognised as a line comment when found in the beginning of a line of text in a CSV file, and the row will be ignored. Set `true` to disable this behavior. - `:max-chars-per-column` - Defaults to 4096. Columns with more characters that this will result in an exception. - `:max-num-columns` - Defaults to 8192. CSV,TSV files with more columns than this will fail to parse. For more information on this option, please visit: https://github.com/uniVocity/univocity-parsers/issues/301 - `:text-temp-dir` - The temporary directory to use for file-backed text. Setting this value to boolean 'false' turns off file backed text which is the default. If a tech.v3.resource stack context is opened the file will be deleted when the context closes else it will be deleted when the gc cleans up the dataset. A shutdown hook is added as a last resort to ensure the file is cleaned up. - `:n-initial-skip-rows` - Skip N rows initially. This currently may include the header row. Works across both csv and spreadsheet datasets. - `:parser-type` - Default parser to use if no parser-fn is specified for that column. For csv files, the default parser type is `:string` which indicates a promotional string parser. For sequences of maps, the default parser type is :object. It can be useful in some contexts to use the `:string` parser with sequences of maps or maps of columns. - `:parser-fn` - - `keyword?` - all columns parsed to this datatype. For example: `{:parser-fn :string}` - `map?` - `{column-name parse-method}` parse each column with specified `parse-method`. The `parse-method` can be: - `keyword?` - parse the specified column to this datatype. For example: `{:parser-fn {:answer :boolean :id :int32}}` - tuple - pair of `[datatype parse-data]` in which case container of type `[datatype]` will be created. `parse-data` can be one of: - `:relaxed?` - data will be parsed such that parse failures of the standard parse functions do not stop the parsing process. :unparsed-values and :unparsed-indexes are available in the metadata of the column that tell you the values that failed to parse and their respective indexes. - `fn?` - function from str-> one of `:tech.v3.dataset/missing`, `:tech.v3.dataset/parse-failure`, or the parsed value. Exceptions here always kill the parse process. :missing will get marked in the missing indexes, and :parse-failure will result in the index being added to missing, the unparsed the column's :unparsed-values and :unparsed-indexes will be updated. - `string?` - for datetime types, this will turned into a DateTimeFormatter via DateTimeFormatter/ofPattern. For `:text` you can specify the backing file to use. - `DateTimeFormatter` - use with the appropriate temporal parse static function to parse the value. - `map?` - the header-name-or-idx is used to lookup value. If not nil, then value can be any of the above options. Else the default column parser is used. Returns a new dataset
(dataset->str ds)
(dataset->str ds 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.
(distance ds columns-selector)
Applies the operation tablecloth.column.api.operators/distance to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 2 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/distance to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 2 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(distance-squared ds columns-selector)
Applies the operation tablecloth.column.api.operators/distance-squared to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 2 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/distance-squared to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 2 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(dot-product ds columns-selector)
Applies the operation tablecloth.column.api.operators/dot-product to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 2 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/dot-product to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 2 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(drop ds columns-selector rows-selector)
Drop columns and rows.
Drop columns and rows.
(drop-columns ds)
(drop-columns ds columns-selector)
(drop-columns ds columns-selector meta-field)
Drop columns by (returns dataset):
Drop columns by (returns dataset): - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(drop-missing ds)
(drop-missing ds 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
(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
(eq ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/eq to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 2 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/eq to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 2 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(even? ds target-col columns-selector)
(even? ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/even? to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/even? to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(exp ds target-col columns-selector)
(exp ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/exp to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/exp to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(expand ds columns-selector & r)
TidyR expand.
Creates all possible combinations of selected columns.
TidyR expand. Creates all possible combinations of selected columns.
(expm1 ds target-col columns-selector)
(expm1 ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/expm1 to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/expm1 to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(fill-range-replace ds colname max-span)
(fill-range-replace ds colname max-span missing-strategy)
(fill-range-replace ds colname max-span missing-strategy missing-value)
Fill missing up with lacking values. Accepts
Fill missing up with lacking values. Accepts * dataset * column name * expected step (max-span, milliseconds in case of datetime column) * (optional) missing-strategy - how to replace missing, default :down (set to nil if none) * (optional) missing-value - optional value for replace missing
(finite? ds target-col columns-selector)
(finite? ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/finite? to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/finite? to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(floor ds target-col columns-selector)
(floor ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/floor to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/floor to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(fold-by ds columns-selector)
(fold-by ds columns-selector folding-function)
Group-by and pack columns into vector - the output data set has a row for each unique combination of the provided columns while each remaining column has its valu(es) collected into a vector, similar to how clojure.core/group-by works. See https://scicloj.github.io/tablecloth/index.html#Fold-by
Group-by and pack columns into vector - the output data set has a row for each unique combination of the provided columns while each remaining column has its valu(es) collected into a vector, similar to how clojure.core/group-by works. See https://scicloj.github.io/tablecloth/index.html#Fold-by
(full-join ds-left ds-right columns-selector)
(full-join ds-left ds-right columns-selector options)
Join keeping all rows
Join keeping all rows
(get-entry ds column row)
Returns a single value from given column and row
Returns a single value from given column and row
(get-significand ds target-col columns-selector)
(get-significand ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/get-significand to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/get-significand to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(group-by ds grouping-selector)
(group-by ds
grouping-selector
{:keys [select-keys result-type]
:or {result-type :as-dataset select-keys :all}
:as options})
Group dataset by:
Options are:
select-keys
seq.:as-dataset
, default) or as map of datasets (:as-map
) or as map of row indexes (:as-indexes
) or as sequence of (sub)datasetsdataset
fnWhen dataset is returned, meta contains :grouped?
set to true. Columns in 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
(grouped? ds)
Is dataset
represents grouped dataset (result of group-by
)?
Is `dataset` represents grouped dataset (result of `group-by`)?
(groups->map ds)
Convert grouped dataset to the map of groups
Convert grouped dataset to the map of groups
(groups->seq ds)
Convert grouped dataset to seq of the groups
Convert grouped dataset to seq of the groups
(hypot ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/hypot to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/hypot to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(identity ds target-col columns-selector)
(identity ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/identity to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/identity to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(ieee-remainder ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/ieee-remainder to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/ieee-remainder to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(infinite? ds target-col columns-selector)
(infinite? ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/infinite? to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/infinite? to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(info ds)
(info ds result-type)
Returns a statistcial information about the columns of a dataset.
result-type
can be :descriptive or :columns
Returns a statistcial information about the columns of a dataset. `result-type ` can be :descriptive or :columns
(inner-join ds-left ds-right columns-selector)
(inner-join ds-left ds-right columns-selector options)
(join-columns ds target-column columns-selector)
(join-columns ds
target-column
columns-selector
{:keys [separator missing-subst drop-columns? result-type
parallel?]
:or {separator "-" drop-columns? true result-type :string}
:as _conf})
Join clumns of dataset. Accepts:
dataset
column selector (as in select-columns)
options
:separator
(default "-")
:drop-columns?
- whether to drop source columns or not (default true)
:result-type
:map
- packs data into map
:seq
- packs data into sequence
:string
- join strings with separator (default)
or custom function which gets row as a vector
:missing-subst
- substitution for missing value
Join clumns of dataset. Accepts: dataset column selector (as in select-columns) options `:separator` (default "-") `:drop-columns?` - whether to drop source columns or not (default true) `:result-type` `:map` - packs data into map `:seq` - packs data into sequence `:string` - join strings with separator (default) or custom function which gets row as a vector `:missing-subst` - substitution for missing value
(kurtosis ds columns-selector)
(kurtosis ds columns-selector options)
Applies the operation tablecloth.column.api.operators/kurtosis to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/kurtosis to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(left-join ds-left ds-right columns-selector)
(left-join ds-left ds-right columns-selector options)
(log ds target-col columns-selector)
(log ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/log to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/log to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(log10 ds target-col columns-selector)
(log10 ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/log10 to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/log10 to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(log1p ds target-col columns-selector)
(log1p ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/log1p to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/log1p to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(logistic ds target-col columns-selector)
(logistic ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/logistic to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/logistic to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(magnitude ds columns-selector)
Applies the operation tablecloth.column.api.operators/magnitude to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/magnitude to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(magnitude-squared ds columns-selector)
Applies the operation tablecloth.column.api.operators/magnitude-squared to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/magnitude-squared to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(map-columns ds column-name map-fn)
(map-columns ds column-name columns-selector map-fn)
(map-columns ds column-name new-type columns-selector map-fn)
Map over rows using a map function. The arity should match the columns selected.
Map over rows using a map function. The arity should match the columns selected.
(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.
(mathematical-integer? ds target-col columns-selector)
(mathematical-integer? ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/mathematical-integer? to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/mathematical-integer? to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(max ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/max to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/max to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(mean ds columns-selector)
(mean ds columns-selector options)
Applies the operation tablecloth.column.api.operators/mean to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/mean to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(mean-fast ds columns-selector)
Applies the operation tablecloth.column.api.operators/mean-fast to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/mean-fast to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(median ds columns-selector)
(median ds columns-selector options)
Applies the operation tablecloth.column.api.operators/median to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/median to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(min ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/min to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/min to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(nan? ds target-col columns-selector)
(nan? ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/nan? to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/nan? to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(neg? ds target-col columns-selector)
(neg? ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/neg? to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/neg? to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(next-down ds target-col columns-selector)
(next-down ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/next-down to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/next-down to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(next-up ds target-col columns-selector)
(next-up ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/next-up to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/next-up to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(normalize ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/normalize to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/normalize to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(not ds target-col columns-selector)
(not ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/not to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/not to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(not-eq ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/not-eq to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 2 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/not-eq to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 2 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(odd? ds target-col columns-selector)
(odd? ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/odd? to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/odd? to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(or ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/or to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 2 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/or to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 2 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(order-by ds columns-or-fn)
(order-by ds columns-or-fn comparators)
(order-by ds columns-or-fn comparators {:keys [parallel?] :as options})
Order dataset by:
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
(percentiles ds target-col columns-selector percentages)
(percentiles ds target-col columns-selector percentages options)
Applies the operation tablecloth.column.api.operators/percentiles to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/percentiles to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(pivot->longer ds)
(pivot->longer ds columns-selector)
(pivot->longer ds
columns-selector
{:keys [target-columns value-column-name splitter drop-missing?
datatypes coerce-to-number?]
:or {target-columns :$column
value-column-name :$value
drop-missing? true
coerce-to-number? true}
:as options})
tidyr
pivot_longer api
`tidyr` pivot_longer api
(pivot->wider ds columns-selector value-columns)
(pivot->wider
ds
columns-selector
value-columns
{:keys [fold-fn concat-columns-with concat-value-with drop-missing?]
:or {concat-columns-with "_" concat-value-with "-" drop-missing? true}
:as options})
Converts columns to rows. Arguments:
dataset
columns selector
options:
:target-columns
- names of the columns created or columns pattern (see below) (default: :$column)
:value-column-name
- name of the column for values (default: :$value)
:splitter
- string, regular expression or function which splits source column names into data
:drop-missing?
- remove rows with missing? (default: true)
:datatypes
- map of target columns data types
:coerce-to-number
- try to convert extracted values to numbers if possible (default: true)
target-columns - can be:
Converts columns to rows. Arguments: * dataset * columns selector * options: `:target-columns` - names of the columns created or columns pattern (see below) (default: :$column) `:value-column-name` - name of the column for values (default: :$value) `:splitter` - string, regular expression or function which splits source column names into data `:drop-missing?` - remove rows with missing? (default: true) `:datatypes` - map of target columns data types `:coerce-to-number` - try to convert extracted values to numbers if possible (default: true) * target-columns - can be: * column name - source columns names are put there as a data * column names as seqence - source columns names after split are put separately into :target-columns as data * pattern - is a sequence of names, where some of the names are nil. nil is replaced by a name taken from splitter and such column is used for values.
(pos? ds target-col columns-selector)
(pos? ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/pos? to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/pos? to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(pow ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/pow to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/pow to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(print-dataset ds)
(print-dataset ds options)
Prints dataset into console. For options see tech.v3.dataset.print/dataset-data->str
Prints dataset into console. For options see tech.v3.dataset.print/dataset-data->str
(process-group-data ds f)
(process-group-data ds f parallel?)
Internal: The passed-in function is applied on all groups
Internal: The passed-in function is applied on all groups
(quartile-1 ds columns-selector)
(quartile-1 ds columns-selector options)
Applies the operation tablecloth.column.api.operators/quartile-1 to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/quartile-1 to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(quartile-3 ds columns-selector)
(quartile-3 ds columns-selector options)
Applies the operation tablecloth.column.api.operators/quartile-3 to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/quartile-3 to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(quot ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/quot to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/quot to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(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
(reduce-* ds columns-selector)
Applies the operation tablecloth.column.api.operators/reduce-* to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/reduce-* to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(reduce-+ ds columns-selector)
Applies the operation tablecloth.column.api.operators/reduce-+ to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/reduce-+ to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(reduce-max ds columns-selector)
Applies the operation tablecloth.column.api.operators/reduce-max to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/reduce-max to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(reduce-min ds columns-selector)
Applies the operation tablecloth.column.api.operators/reduce-min to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/reduce-min to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(rem ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/rem to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/rem to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(rename-columns ds columns-mapping)
(rename-columns ds columns-selector columns-map-fn)
Rename columns with provided old -> new name map
Rename columns with provided old -> new name map
(reorder-columns ds 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.
(replace-missing ds)
(replace-missing ds strategy)
(replace-missing ds columns-selector strategy)
(replace-missing ds columns-selector strategy value)
Replaces missing values. Accepts
Strategies are:
:value
- replace with given value
:up
- copy values up
:down
- copy values down
:updown
- copy values up and then down for missing values at the end
:downup
- copy values down and then up for missing values at the beginning
:mid
or :nearest
- copy values around known values
:midpoint
- use average value from previous and next non-missing
:lerp
- trying to lineary approximate values, works for numbers and datetime, otherwise applies :nearest. For numbers always results in float datatype.
Replaces missing values. Accepts * dataset * column selector, default: :all * strategy, default: :nearest * value (optional) * single value * sequence of values (cycled) * function, applied on column(s) with stripped missings Strategies are: `:value` - replace with given value `:up` - copy values up `:down` - copy values down `:updown` - copy values up and then down for missing values at the end `:downup` - copy values down and then up for missing values at the beginning `:mid` or `:nearest` - copy values around known values `:midpoint` - use average value from previous and next non-missing `:lerp` - trying to lineary approximate values, works for numbers and datetime, otherwise applies :nearest. For numbers always results in float datatype.
(right-join ds-left ds-right columns-selector)
(right-join ds-left ds-right columns-selector options)
(rint ds target-col columns-selector)
(rint ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/rint to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/rint to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(round ds target-col columns-selector)
(round ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/round to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/round to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(rows ds)
(rows ds result-type)
(rows ds result-type {:keys [nil-missing?] :or {nil-missing? true} :as options})
Returns rows of dataset. Result type can be any of:
:as-maps
- maps:as-double-arrays
- double arrays:as-seqs
- reader (sequence, default):as-vecs
- vectorsIf you want to elide nils in maps set :nil-missing?
option to false (default: true
).
Another option - :copying?
- when true row values are copied on read (default: false
).
Returns rows of dataset. Result type can be any of: * `:as-maps` - maps * `:as-double-arrays` - double arrays * `:as-seqs` - reader (sequence, default) * `:as-vecs` - vectors If you want to elide nils in maps set `:nil-missing?` option to false (default: `true`). Another option - `:copying?` - when true row values are copied on read (default: `false`).
(select ds columns-selector rows-selector)
Select columns and rows.
Select columns and rows.
(select-columns ds)
(select-columns ds columns-selector)
(select-columns ds columns-selector meta-field)
Select columns by (returns dataset):
Select columns by (returns dataset): - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(select-missing ds)
(select-missing ds 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
(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
(semi-join ds-left ds-right columns-selector)
(semi-join ds-left ds-right columns-selector options)
(separate-column ds column)
(separate-column ds column separator)
(separate-column ds column target-columns separator)
(separate-column ds
column
target-columns
separator
{:keys [missing-subst drop-column? parallel?]
:or {missing-subst ""}
:as _conf})
(shape ds)
Returns shape of the dataset [rows, cols]
Returns shape of the dataset [rows, cols]
(shift ds target-col columns-selector n)
Applies the operation tablecloth.column.api.operators/shift to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/shift to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(shuffle ds)
(shuffle ds {:keys [seed] :as options})
Shuffle dataset (with seed)
Shuffle dataset (with seed)
(signum ds target-col columns-selector)
(signum ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/signum to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/signum to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(sin ds target-col columns-selector)
(sin ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/sin to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/sin to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(sinh ds target-col columns-selector)
(sinh ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/sinh to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/sinh to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(skew ds columns-selector)
(skew ds columns-selector options)
Applies the operation tablecloth.column.api.operators/skew to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/skew to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(split ds)
(split ds split-type)
(split ds
split-type
{:keys [seed parallel? shuffle?] :or {shuffle? true} :as 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 idsplit-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
):ratio
- specify a list of split ratios for :holdout
. Need to have same size then :split-names
(example: [0.2 0.2 0.6])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`) * `:ratio` - specify a list of split ratios for `:holdout`. Need to have same size then `:split-names` (example: [0.2 0.2 0.6]) 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)
(split->seq ds)
(split->seq ds split-type)
(split->seq ds
split-type
{:keys [split-col-name split-id-col-name]
:or {split-col-name :$split-name split-id-col-name :$split-id}
:as 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)
(sq ds target-col columns-selector)
(sq ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/sq to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/sq to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(sqrt ds target-col columns-selector)
(sqrt ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/sqrt to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/sqrt to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(sum ds columns-selector)
(sum ds columns-selector options)
Applies the operation tablecloth.column.api.operators/sum to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/sum to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(sum-fast ds columns-selector)
Applies the operation tablecloth.column.api.operators/sum-fast to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/sum-fast to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(tan ds target-col columns-selector)
(tan ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/tan to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/tan to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(tanh ds target-col columns-selector)
(tanh ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/tanh to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/tanh to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(to-degrees ds target-col columns-selector)
(to-degrees ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/to-degrees to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/to-degrees to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(to-radians ds target-col columns-selector)
(to-radians ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/to-radians to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/to-radians to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(ulp ds target-col columns-selector)
(ulp ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/ulp to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/ulp to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(ungroup ds)
(ungroup ds
{:keys [order? add-group-as-column add-group-id-as-column separate?
dataset-name parallel?]
:or {separate? true}
:as 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.
(unique-by ds)
(unique-by ds columns-selector)
(unique-by
ds
columns-selector
{:keys [strategy select-keys parallel?] :or {strategy :first} :as options})
Remove rows which contains the same data
column-selector
Select columns for uniqueness
strategy
There are 4 strategies defined to handle duplicates
:first
- select first row (default)
:last
- select last row
:random
- select random row
any function - apply function to a columns which are subject of uniqueness
Remove rows which contains the same data `column-selector` Select columns for uniqueness `strategy` There are 4 strategies defined to handle duplicates `:first` - select first row (default) `:last` - select last row `:random` - select random row any function - apply function to a columns which are subject of uniqueness
(unroll ds columns-selector)
(unroll ds columns-selector options)
Unfolds sequences stored inside a column(s), turning it into multiple columns. Opposite of fold-by
.
Add each of the provided columns to the set that defines the "uniqe key" of each row.
Thus there will be a new row for each value inside the target column(s)' value sequence.
If you want instead to split the content of the columns into a set of new columns, look at separate-column
.
See https://scicloj.github.io/tablecloth/index.html#Unroll
Unfolds sequences stored inside a column(s), turning it into multiple columns. Opposite of [[fold-by]]. Add each of the provided columns to the set that defines the "uniqe key" of each row. Thus there will be a new row for each value inside the target column(s)' value sequence. If you want instead to split the content of the columns into a set of new _columns_, look at [[separate-column]]. See https://scicloj.github.io/tablecloth/index.html#Unroll
(unsigned-bit-shift-right ds target-col columns-selector)
Applies the operation tablecloth.column.api.operators/unsigned-bit-shift-right to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. null
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/unsigned-bit-shift-right to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. null `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(update-columns ds columns-map)
(update-columns ds columns-selector update-functions)
(variance ds columns-selector)
(variance ds columns-selector options)
Applies the operation tablecloth.column.api.operators/variance to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/variance to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
(write! dataset output-path)
(write! dataset 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.
(zero? ds target-col columns-selector)
(zero? ds target-col columns-selector options)
Applies the operation tablecloth.column.api.operators/zero? to the columns selected by
columns-selector
and returns a new ds with the the result in
target-col
. This operation takes a maximum of 1 columns, so
columns-selector
can yield no more than that many columns.
`columns-selector can be:
Applies the operation tablecloth.column.api.operators/zero? to the columns selected by `columns-selector` and returns a new ds with the the result in `target-col`. This operation takes a maximum of 1 columns, so `columns-selector` can yield no more than that many columns. `columns-selector can be: - name - sequence of names - map of names with new names (rename) - function which filter names (via column metadata)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close