mobgap.pipeline.iter_gs#

mobgap.pipeline.iter_gs(
data: DataFrame,
gs_list: DataFrame,
) Iterator[tuple[GaitSequence | WalkingBout, DataFrame]][source]#

Iterate over the data based on the given gait-sequences.

This will yield a dataframe for each gait-sequence. We assume that the gait-sequences are sorted by start time and contain a start and end column that match the units of the data index.

Parameters:
data

The data to iterate over.

gs_list

The list of gait-sequences.

Yields:
Union[GaitSequence, WalkingBout]

A named tuple representing the gait-sequence or walking-bout. Note, that only the start, end and id attributes are present. If other columns are present in the gs_list, they will be ignored. Independent of the “type” a unique id attribute is present, that represents either the gs_id or the wb_id.

pd.DataFrame

The data of a single gait-sequence. Note, that we don’t change the index of the data. If the data was using an index that started at the beginning of the recording, the index of the individual sequences will still be relative to the beginning of the recording.