Correlation
Base classes
| Name |
Children |
Inherits |
SubsetCallOp datacook.engine.ops.stats A frame method on all columns or on the `columns` subset, with a new table as result. |
|
|
⋔ Inheritance diagram
graph TD
2841429158["stats.Correlation"]
3269268830["stats.SubsetCallOp"]
3484306131["base.CallOp"]
1539482213["base.Op"]
2751680898["builtins.object"]
3269268830 --> 2841429158
3484306131 --> 3269268830
1539482213 --> 3484306131
2751680898 --> 1539482213
🛈 DocStrings
Bases: SubsetCallOp
Source code in src/datacook/engine/ops/stats.py
| class Correlation(SubsetCallOp):
id = "corr"
title = _("Correlations")
description = _("Correlation matrix of the numeric columns (Pearson, Spearman or Kendall).")
icon = "mdi.chart-scatter-plot"
method = "corr"
always = ("numeric_only",)
then = '.reset_index(names="column")'
class Params(base.Params):
columns: list[str] | None = _subset()
method: CorrelationMethod = _method()
min_periods: int = Field(1, title=N_("Minimum values"), ge=1)
numeric_only: bool = _numeric_only()
@classmethod
def finish(cls, params: Any, result: Any) -> Any:
return result.reset_index(names="column")
|
:fa-brands-github: Show source on GitHub