mne_plsc.utils.average_epochs_by_metadata#

mne_plsc.utils.average_epochs_by_metadata(epochs_list, column, between=None)#

From a list of epoch data, get a list of average data, one per unique value in a metadata column per participant, and a design matrix.

Parameters:
  • epochs_list (mne.Epochs | mne.time_frequency.EpochsSpectrum | mne.time_frequency.EpochsTFR) – MNE data object containing epoch data.

  • column (str) – Name of the column in each epoch’s metadata containing a variable that should be used to stratify observations. I.e., the name of the column containing the within-subjects experimental condition.

  • between (iterable) – Iterable of between-participants condition labels corresponding to each element in epochs_list.

Returns:

  • data_list (list) – List containing epoch averages

  • design (pd.DataFrame) – Design matrix

Examples

>>> labels = get_epoch_labels(epo)