Liking cljdoc? Tell your friends :D
Clojure only.

tablecloth.api.rolling


cumsum-colclj

(cumsum-col ds column-name)
(cumsum-col ds new-column-name column-name)

Compute the cumulative sum of a column

Usage

(cumsum ds column-name)

(cumsum ds new-column-name column-name)

Arguments

  • ds - A tech.ml.dataset (i.e a tablecloth dataset)
  • new-column-name - optional Name for the column where newly computed values will go. When ommitted new column name defaults to the keyword <old-column-name>-cumulative-sum
  • column-name - Name of the column to use to compute the cumulative sum

Returns

A dataset with the additional column containing the cumulative sum.

Compute the cumulative sum of a column

## Usage

`(cumsum ds column-name)`

`(cumsum ds new-column-name column-name)`

## Arguments

- `ds` - A `tech.ml.dataset` (i.e a `tablecloth` dataset)
- `new-column-name` - __optional__ Name for the column where newly computed values will go.
  When ommitted new column name defaults to the keyword `<old-column-name>-cumulative-sum`
- `column-name` - Name of the column to use to compute the cumulative sum

## Returns

A dataset with the additional column containing the cumulative sum.
sourceraw docstring

lagclj

(lag ds column-name lag-size)
(lag ds new-column-name column-name lag-size)

Compute previous (lagged) values from one column in a new column, can be used e.g. to compare values behind the current value.

Usage

(lag ds column-name lag-size)

(lag ds new-column-name column-name lag-size)

Arguments

  • ds - A tech.ml.dataset (i.e a tablecloth dataset)
  • new-column-name - optional Name for the column where newly computed values will go. When ommitted new column name defaults to the keyword <old-column-name>-lag-<lag-size>
  • column-name - Name of the column to use to compute the lagged values
  • lag-size - positive integer indicating how many rows to skip over to compute the lag

Returns

A dataset with the new column populated with the lagged values.

Compute previous (lagged) values from one column in a new column, can be used e.g. to compare values behind the current value.

## Usage

`(lag ds column-name lag-size)`

`(lag ds new-column-name column-name lag-size)`

## Arguments

- `ds` - A `tech.ml.dataset` (i.e a `tablecloth` dataset)
- `new-column-name` - __optional__ Name for the column where newly computed values will go.
  When ommitted new column name defaults to the keyword `<old-column-name>-lag-<lag-size>`
- `column-name` - Name of the column to use to compute the lagged values
- `lag-size` - positive integer indicating how many rows to skip over to compute the lag

## Returns

A dataset with the new column populated with the lagged values.
sourceraw docstring

leadclj

(lead ds column-name lead-size)
(lead ds new-column-name column-name lead-size)

Compute next (lead) values from one column in a new column, can be used e.g. to compare values ahead of the current value.

Usage

(lead ds column-name lead-size)

(lead ds new-column-name column-name lead-size)

Arguments

  • ds - A tech.ml.dataset (i.e a tablecloth dataset)
  • new-column-name - optional Name for the column where newly computed values will go. When ommitted new column name defaults to the keyword <old-column-name>-lead-<lead-size>
  • column-name - Name of the column to use to compute the lead values
  • lead-size - positive integer indicating how many rows to skip over to compute the lead

Returns

A dataset with the column populated with the lead values.

Compute next (lead) values from one column in a new column, can be used e.g. to compare values ahead of the current value.

## Usage

`(lead ds column-name lead-size)`

`(lead ds new-column-name column-name lead-size)`

## Arguments

- `ds` - A `tech.ml.dataset` (i.e a `tablecloth` dataset)
- `new-column-name` - __optional__ Name for the column where newly computed values will go.
  When ommitted new column name defaults to the keyword `<old-column-name>-lead-<lead-size>`
- `column-name` - Name of the column to use to compute the lead values
- `lead-size` - positive integer indicating how many rows to skip over to compute the lead

## Returns

A dataset with the column populated with the lead values.
sourceraw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close