Skip to content

mecfs_bio.build_system.task.pipes.scale_col_pipe

Classes:

ScaleColPipe

Bases: DataProcessingPipe

Methods:

Attributes:

col instance-attribute

col: str

scale_factor instance-attribute

scale_factor: float

process

process(x: LazyFrame) -> narwhals.LazyFrame
Source code in mecfs_bio/build_system/task/pipes/scale_col_pipe.py
def process(self, x: narwhals.LazyFrame) -> narwhals.LazyFrame:
    return x.with_columns(
        (self.scale_factor * narwhals.col(self.col)).alias(self.col)
    )