piel.base.experimental.measurements.data.experiment

piel.base.experimental.measurements.data.experiment#

Functions#

index_experiment_data(instance, index)

Indexes the data attribute of an ExperimentData instance based on an integer, slice, or pandas DataFrame.

Module Contents#

index_experiment_data(instance, index: int | slice | pandas.DataFrame)[source]#

Indexes the data attribute of an ExperimentData instance based on an integer, slice, or pandas DataFrame. Returns a new ExperimentData instance with the indexed data, preserving all other attributes.

If a pandas DataFrame is provided, it extracts the corresponding indices and uses them to index the data.

Parameters:
  • instance – The ExperimentData instance to index.

  • index – An integer index, slice, or pandas DataFrame specifying the subset.

Returns:

A new ExperimentData instance with the indexed data.