Skip to main content

Module series

Module series 

Source
Expand description

Vector math over columns: what math code spaces compile to, and handy in Rust ones. Missing values are NaN; windows that are not full yet give NaN.

Functionsยง

choose
if(c, a, b): a where c is true (not 0, not NaN), else b.
count
count_arg
The first value of a window/period argument, as a count (at least 1).
cumsum
Running total (NaN counts as 0).
diff
Change from the previous row.
ema
Exponential moving average with span n (alpha = 2 / (n + 1)), seeded with the first value.
first
flag
k
n copies of v.
lag
The value n rows earlier.
last
lead
The value n rows later.
map
max
mean
min
pct_change
Change from the previous row in percent.
rolling_max
rolling_min
rolling_std
rolling_sum
row
Row number from 0.
sma
Simple moving average over n values.
std
sum
Aggregates: one value, repeated for every row.
truthy
zip
Element by element (a and b have the same length).
zscore
Standard score against the whole column.