mne.epochs.combine_event_ids#

mne.epochs.combine_event_ids(epochs, old_event_ids, new_event_id, copy=True)[source]#

Collapse event_ids from an epochs instance into a new event_id.

Parameters
epochsinstance of Epochs

The epochs to operate on.

old_event_idsstr, or list

Conditions to collapse together.

new_event_iddict, or int

A one-element dict (or a single integer) for the new condition. Note that for safety, this cannot be any existing id (in epochs.event_id.values()).

copybool

Whether to return a new instance or modify in place.

Returns
epochsinstance of Epochs

The modified epochs.

Notes

This For example (if epochs.event_id was {'Left': 1, 'Right': 2}:

combine_event_ids(epochs, ['Left', 'Right'], {'Directional': 12})

would create a ‘Directional’ entry in epochs.event_id replacing ‘Left’ and ‘Right’ (combining their trials).