Skip to content

Mode

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
  3771413360["stats.Mode"]
  3269268830["stats.SubsetCallOp"]
  3484306131["base.CallOp"]
  1539482213["base.Op"]
  2751680898["builtins.object"]
  3269268830 --> 3771413360
  3484306131 --> 3269268830
  1539482213 --> 3484306131
  2751680898 --> 1539482213

🛈 DocStrings

Bases: SubsetCallOp

Source code in src/datacook/engine/ops/stats.py
class Mode(SubsetCallOp):
    id = "mode"
    title = _("Most frequent values")
    description = _(
        "The most frequent value(s) of each column (mode): one row per mode, missing values"
        " where a column has fewer modes."
    )
    method = "mode"

    class Params(base.Params):
        columns: list[str] | None = _subset()
        numeric_only: bool = Field(False, title=N_("Numeric columns only"))
        dropna: bool = Field(True, title=N_("Ignore missing values"))

:fa-brands-github: Show source on GitHub