Skip to content

PctChange

Base classes

Name Children Inherits
SeriesOp
datacook.engine.ops.series
A `ColumnOp` that is one call per column, declared like `CallOp`.

⋔ Inheritance diagram

graph TD
  1757544742["timeseries.PctChange"]
  2451904138["series.SeriesOp"]
  124287307["series.ColumnOp"]
  1539482213["base.Op"]
  2751680898["builtins.object"]
  2451904138 --> 1757544742
  124287307 --> 2451904138
  1539482213 --> 124287307
  2751680898 --> 1539482213

🛈 DocStrings

Bases: SeriesOp

Source code in src/datacook/engine/ops/timeseries.py
class PctChange(series.SeriesOp):
    id = "pct_change"
    title = _("Relative change")
    description = _("Relative change to the value n rows before (0.1 = +10 %).")
    category = categories.TIMESERIES
    icon = "mdi.percent-outline"
    method = "pct_change"

    class Params(series.ColumnParams):
        periods: int = Field(1, title=N_("Rows"))

:fa-brands-github: Show source on GitHub