This documentation is for development version 0.18.dev0.


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.

epochs : instance of Epochs

The epochs to operate on.

old_event_ids : str, or list

Conditions to collapse together.

new_event_id : dict, 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()).

copy : bool

Whether to return a new instance or modify in place.


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).