@classmethod
def process_data(cls, rollout: 'StepSequence', fcn: Callable, fcn_arg_name: str, fcn_arg_types: Union[(type, Tuple[type])]=np.ndarray, include_fields: Sequence[str]=None, exclude_fields: Sequence[str]=None, **process_fcn_kwargs):
    '\n        Process all data fields of a rollouts using an arbitrary function. Optionally, some fields can be excluded.\n\n        :param rollout: `StepSequence` holding the data\n        :param fcn: function (of one remaining input) to used manipulate the data fields, e.g. `scipy.filtfilt()`\n        :param fcn_arg_name: sting of the remaining input of `process_fcn()`, e.g. `x` for `scipy.filtfilt()`\n        :param fcn_arg_types: type or tuple thereof which are expected as input to `fcn()`\n        :param include_fields: list of field names to include for processing, pass `None` to not include everything.\n                               If specified, only fields from this selection will be considered\n        :param exclude_fields: list of field names to exclude from processing, pass `None` to not exclude anything\n        :param process_fcn_kwargs: keyword arguments forwarded to `process_fcn()`\n        :return: new `StepSequence` instance with processed data\n        '

    @functools.wraps(fcn)
    def recursive_wrapper(inp, **kwargs):
        ' Wrap the processing function to call it recursivelyy for nested data structures. '
        kwargs.update({fcn_arg_name: inp})
        if isinstance(inp, fcn_arg_types):
            inp = fcn(**kwargs)
        elif isinstance(inp, dict):
            for (key, value) in inp.items():
                if isinstance(value, fcn_arg_types):
                    inp[key] = recursive_wrapper(value, **kwargs)
                else:
                    inp[key] = value
        elif isinstance(inp, list):
            for (idx, item) in enumerate(inp):
                if isinstance(item, fcn_arg_types):
                    inp[idx] = recursive_wrapper(item, **kwargs)
                else:
                    inp[idx] = item
        return inp
    data_dict = dict()
    include_fields = (include_fields or rollout.data_names)
    exclude_fields = (exclude_fields or [])
    for name in rollout.data_names:
        data = rollout.get_data_values(name)
        if ((name in include_fields) and (name not in exclude_fields)):
            data = recursive_wrapper(data, **process_fcn_kwargs)
        data_dict[name] = data
    return StepSequence(**data_dict, rollout_info=rollout.rollout_info, continuous=rollout.continuous)
Process all data fields of a rollouts using an arbitrary function. Optionally, some fields can be excluded.

:param rollout: `StepSequence` holding the data
:param fcn: function (of one remaining input) to used manipulate the data fields, e.g. `scipy.filtfilt()`
:param fcn_arg_name: sting of the remaining input of `process_fcn()`, e.g. `x` for `scipy.filtfilt()`
:param fcn_arg_types: type or tuple thereof which are expected as input to `fcn()`
:param include_fields: list of field names to include for processing, pass `None` to not include everything.
                       If specified, only fields from this selection will be considered
:param exclude_fields: list of field names to exclude from processing, pass `None` to not exclude anything
:param process_fcn_kwargs: keyword arguments forwarded to `process_fcn()`
:return: new `StepSequence` instance with processed data
@classmethod
def process_data(cls, rollout: 'StepSequence', fcn: Callable, fcn_arg_name: str, fcn_arg_types: Union[(type, Tuple[type])]=np.ndarray, include_fields: Sequence[str]=None, exclude_fields: Sequence[str]=None, **process_fcn_kwargs):
    '\n        Process all data fields of a rollouts using an arbitrary function. Optionally, some fields can be excluded.\n\n        :param rollout: `StepSequence` holding the data\n        :param fcn: function (of one remaining input) to used manipulate the data fields, e.g. `scipy.filtfilt()`\n        :param fcn_arg_name: sting of the remaining input of `process_fcn()`, e.g. `x` for `scipy.filtfilt()`\n        :param fcn_arg_types: type or tuple thereof which are expected as input to `fcn()`\n        :param include_fields: list of field names to include for processing, pass `None` to not include everything.\n                               If specified, only fields from this selection will be considered\n        :param exclude_fields: list of field names to exclude from processing, pass `None` to not exclude anything\n        :param process_fcn_kwargs: keyword arguments forwarded to `process_fcn()`\n        :return: new `StepSequence` instance with processed data\n        '

    @functools.wraps(fcn)
    def recursive_wrapper(inp, **kwargs):
        ' Wrap the processing function to call it recursivelyy for nested data structures. '
        kwargs.update({fcn_arg_name: inp})
        if isinstance(inp, fcn_arg_types):
            inp = fcn(**kwargs)
        elif isinstance(inp, dict):
            for (key, value) in inp.items():
                if isinstance(value, fcn_arg_types):
                    inp[key] = recursive_wrapper(value, **kwargs)
                else:
                    inp[key] = value
        elif isinstance(inp, list):
            for (idx, item) in enumerate(inp):
                if isinstance(item, fcn_arg_types):
                    inp[idx] = recursive_wrapper(item, **kwargs)
                else:
                    inp[idx] = item
        return inp
    data_dict = dict()
    include_fields = (include_fields or rollout.data_names)
    exclude_fields = (exclude_fields or [])
    for name in rollout.data_names:
        data = rollout.get_data_values(name)
        if ((name in include_fields) and (name not in exclude_fields)):
            data = recursive_wrapper(data, **process_fcn_kwargs)
        data_dict[name] = data
    return StepSequence(**data_dict, rollout_info=rollout.rollout_info, continuous=rollout.continuous)