CustomOperation#
- class mobgap.utils.df_operations.CustomOperation(
- identifier: Hashable | Sequence | str | None,
- function: Callable,
- column_name: str | tuple[str, ...],
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)#
- count(value, /)#
Return number of occurrences of value.
- index(value, start=0, stop=sys.maxsize, /)#
Return first index of value.
Raises ValueError if the value is not present.