Module Talon.Agg
Column-wise aggregation operations.
All numeric aggregations coerce any numeric column to float, eliminating the need for type-specific sub-modules.
Scalar aggregations
These reduce a column to a single scalar value.
val sum : t -> string -> floatsum df name is the sum of non-null values in column name as float.
val mean : t -> string -> floatmean df name is the arithmetic mean of non-null values in column name.
val std : t -> string -> floatstd df name is the population standard deviation of column name (divides by n, not n-1).
val var : t -> string -> floatvar df name is the population variance of column name (divides by n, not n-1).
val min : t -> string -> float optionmin df name is the minimum non-null value, or None if the column is empty or all null.
val max : t -> string -> float optionmax df name is the maximum non-null value, or None if the column is empty or all null.
val median : t -> string -> floatmedian df name is the median (50th percentile) of column name.
val quantile : t -> string -> q:float -> floatquantile df name ~q is the q-th quantile of column name (q in [0;1]).
Generic aggregations
val count : t -> string -> intcount df name is the number of non-null values in column name.
val nunique : t -> string -> intnunique df name is the number of unique non-null values in column name.
Row-wise (horizontal) aggregations
These compute aggregations across columns for each row.
row_sum ?skipna df ~names is the row-wise sum across the named columns. skipna defaults to true: skip null values. When false, any null in a row makes the entire row result null.
row_mean ?skipna df ~names is the row-wise mean across the named columns. skipna defaults to true.
row_min ?skipna df ~names is the row-wise minimum across the named columns. skipna defaults to true.
row_max ?skipna df ~names is the row-wise maximum across the named columns. skipna defaults to true.
dot df ~names ~weights is the weighted sum (dot product) across the named columns for each row.
weights must have the same length as names. Raises Invalid_argument if lengths differ or columns are not numeric.
row_all df ~names is the row-wise logical AND across the named boolean columns.
Each row is true only if all values are Some true. None and Some false both count as false. Raises Invalid_argument if any column is not boolean or does not exist.
row_any df ~names is the row-wise logical OR across the named boolean columns.
Each row is true if any value is Some true. Raises Invalid_argument if any column is not boolean or does not exist.
String aggregations
module String : sig ... endBoolean aggregations
module Bool : sig ... end