Skip to content

Slice

Base classes

Name Children Inherits
TextOp
datacook.engine.ops.strings

⋔ Inheritance diagram

graph TD
  3140184606["strings.Slice"]
  4127298390["strings.TextOp"]
  2451904138["series.SeriesOp"]
  124287307["series.ColumnOp"]
  1539482213["base.Op"]
  2751680898["builtins.object"]
  4127298390 --> 3140184606
  2451904138 --> 4127298390
  124287307 --> 2451904138
  1539482213 --> 124287307
  2751680898 --> 1539482213

🛈 DocStrings

Bases: TextOp

Source code in src/datacook/engine/ops/strings.py
class Slice(TextOp):
    id = "str_slice"
    title = _("Slice text")
    description = _(
        "Keep the characters from start to stop (Python slice, negative = from the end)."
    )
    icon = "mdi.content-cut"
    method = "slice"

    class Params(series.ColumnParams):
        start: int | None = Field(None, title=N_("Start"))
        stop: int | None = Field(None, title=N_("Stop"))
        step: int | None = Field(None, title=N_("Step"))

:fa-brands-github: Show source on GitHub