stats
Class info¶
Classes¶
| Name | Children | Inherits |
|---|---|---|
| Bin datacook.engine.ops.stats `pd.cut`: equal-width bins (a number) or bins between edges (a list). |
||
| Correlation datacook.engine.ops.stats |
||
| CorrelationWith datacook.engine.ops.stats `df.corrwith(other)`: columns matched by name, rows by position (no index). |
||
| Covariance datacook.engine.ops.stats |
||
| Describe datacook.engine.ops.stats |
||
| Mode datacook.engine.ops.stats |
||
| Rank datacook.engine.ops.stats |
||
| SubsetCallOp datacook.engine.ops.stats A frame method on all columns or on the `columns` subset, with a new table as result. |
||
| ValueCounts datacook.engine.ops.stats |
||
| Variance datacook.engine.ops.stats |
🛈 DocStrings¶
Statistics ops: describe, variances, correlations, modes, value counts, ranks, bins.
Correlations also with another table; bins via pd.cut.
Summary results are new tables like every other step: row labels become a column
(statistic / column), e.g. df.corr().reset_index(names="column"). Rank and binning
are column ops (ops/series.py): results go to <column>_rank / <column>_bin by default.
Bin
¶
Bases: SeriesOp
pd.cut: equal-width bins (a number) or bins between edges (a list).
Source code in src/datacook/engine/ops/stats.py
CorrelationWith
¶
Bases: CallOp
df.corrwith(other): columns matched by name, rows by position (no index).
Pearson only: pandas computes Spearman / Kendall here with scipy (no dependency).
Source code in src/datacook/engine/ops/stats.py
SubsetCallOp
¶
Bases: CallOp
A frame method on all columns or on the columns subset, with a new table as result.
out = df[["x", "y"]].corr(method="spearman").reset_index(names="column") (then is
the tail, finish() its execution). columns is never passed to the method.