Skip to content

Shift

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
  442448947["timeseries.Shift"]
  2451904138["series.SeriesOp"]
  124287307["series.ColumnOp"]
  1539482213["base.Op"]
  2751680898["builtins.object"]
  2451904138 --> 442448947
  124287307 --> 2451904138
  1539482213 --> 124287307
  2751680898 --> 1539482213

🛈 DocStrings

Bases: SeriesOp

Source code in src/datacook/engine/ops/timeseries.py
class Shift(series.SeriesOp):
    id = "shift"
    title = _("Shift values")
    description = _("Move values down (positive periods) or up (negative) by rows.")
    category = categories.TIMESERIES
    icon = "mdi.arrow-expand-down"
    method = "shift"

    class Params(series.ColumnParams):
        periods: int = Field(1, title=N_("Rows"))
        fill_value: float | None = Field(None, title=N_("Value for new cells"))

:fa-brands-github: Show source on GitHub