Skip to content

mecfs_bio.build_system.task.pipes.str_split_col

Classes:

SplitColPipe

Bases: DataProcessingPipe

Methods:

Attributes:

col_to_split instance-attribute

col_to_split: str

new_col_name instance-attribute

new_col_name: str

split_by instance-attribute

split_by: str

process

process(x: LazyFrame) -> narwhals.LazyFrame
Source code in mecfs_bio/build_system/task/pipes/str_split_col.py
def process(self, x: narwhals.LazyFrame) -> narwhals.LazyFrame:
    return x.with_columns(
        narwhals.col(self.col_to_split)
        .str.split(self.split_by)
        .alias(self.new_col_name)
    )