mne.merge_events#
- mne.merge_events(events, ids, new_id, replace_events=True)[source]#
Merge a set of events.
- Parameters
- Returns
- new_events
array
, shape (n_events_out, 3) The new events.
- new_events
Notes
Rather than merging events you can use hierarchical event_id in Epochs. For example, here:
>>> event_id = {'auditory/left': 1, 'auditory/right': 2}
And the condition ‘auditory’ would correspond to either 1 or 2.
Examples
Here is quick example of the behavior:
>>> events = [[134, 0, 1], [341, 0, 2], [502, 0, 3]] >>> merge_events(events, [1, 2], 12, replace_events=True) array([[134, 0, 12], [341, 0, 12], [502, 0, 3]]) >>> merge_events(events, [1, 2], 12, replace_events=False) array([[134, 0, 1], [134, 0, 12], [341, 0, 2], [341, 0, 12], [502, 0, 3]])
Examples using mne.merge_events
#
Working with events