mobgap.pipeline.create_aggregate_df#

mobgap.pipeline.create_aggregate_df(
result_name: str,
fix_offset_cols: Sequence[str] = ('start', 'end'),
*,
fix_offset_index: bool = False,
_null_value: _NotSet = NOT_SET,
) Callable[[list[GsIterator.IteratorResult[Any]]], DataFrame][source]#

Create an aggregator for the GS iterator that aggregates dataframe results into a single dataframe.

The aggregator will also fix the offset of the given columns by adding the start value of the gait-sequence. This way the final dataframe will have all sample based time-values relative to the start of the recording.

Parameters:
result_name

The name of the result key within the result object, the aggregation is applied to

fix_offset_cols

The columns that should be adapted to be relative to the start of the recording. By default, this is ("start", "end"). If you don’t want to fix any columns, you can set this to an empty list.

fix_offset_index

If True, the index of the dataframes will be adapted to be relative to the start of the recording. This only makes sense, if the index represents sample values relative to the start of the gs.

_null_value

A fixed value that should indicate that no results were produced. You don’t need to change this, unless you are doing very advanced stuff.

Notes

Fixing the offset works by getting the start value of the gait-sequence and adding it to the respective columns. This is “easy” for the main iteration, where the gait-sequences contains all the relevant information. For sub-iteration, we need to consider the parent context. For this, the GS-Iterator, places the parent gait-sequence in the iteration context.