CustomOperation#

class mobgap.utils.df_operations.CustomOperation(
identifier: Hashable | Sequence | str | None,
function: Callable,
column_name: str | tuple[str, ...],
)[source]#

Metadata for custom aggregations and transformations.

Parameters:
identifier

The data identifier to select the relevant columns from the DataFrame. If None, the entire DataFrame is used. Otherwise, it needs to be a valid loc indexer for the DataFrame (df.loc[:, identifier]).

function

The function to apply. They will get the selected data as first argument. There expected return value depends on the context the CustomOperation is used in.

column_name

The name of the resulting column in the output dataframe.

Methods

count(value, /)

Return number of occurrences of value.

index(value[, start, stop])

Return first index of value.

__init__(*args, **kwargs)#
column_name: str | tuple[str, ...]#

Alias for field number 2

count(value, /)#

Return number of occurrences of value.

function: Callable#

Alias for field number 1

identifier: Hashable | Sequence | str | None#

Alias for field number 0

index(value, start=0, stop=sys.maxsize, /)#

Return first index of value.

Raises ValueError if the value is not present.

Examples using mobgap.utils.df_operations.CustomOperation#

Evaluation of final walking bout level DMOs

Evaluation of final walking bout level DMOs

Cadence Evaluation

Cadence Evaluation

Stride Length Evaluation

Stride Length Evaluation