Collapse event_ids from an epochs instance into a new event_id.
Epochs
The epochs to operate on.
str
, or list
Conditions to collapse together.
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()).
Whether to return a new instance or modify in place.
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).