Skip to content

mecfs_bio.build_system.task.pipes.head_pipe

Classes:

  • HeadPipe

    Pipe to extract first rows of a dataframe

HeadPipe

Bases: DataProcessingPipe

Pipe to extract first rows of a dataframe

Can be useful in writing tests that operate on a subset of a large dataset.

Methods:

Attributes:

num_rows instance-attribute

num_rows: int

process

process(x: LazyFrame) -> narwhals.LazyFrame
Source code in mecfs_bio/build_system/task/pipes/head_pipe.py
def process(self, x: narwhals.LazyFrame) -> narwhals.LazyFrame:
    return x.head(self.num_rows)