iter_rows

function of dascore.utils.pd source

iter_rows(
    df: DataFrame ,
    row_type: type[None] ,
)-> ‘Iterator[_RowType]’

Iterate over a dataframe’s rows as named tuples of a known shape.

Parameters

Parameter Description
df The dataframe to iterate.
row_type A NamedTuple declaring the columns the caller reads. Pandas builds
the row tuple dynamically, so this only names the shape for
readers (and type checkers); it is never instantiated. The frame’s
index is left out so the declared fields line up with the row’s.