mne.
merge_events
(events, ids, new_id, replace_events=True)[source]¶Merge a set of events.
Parameters: | events : array, shape (n_events_in, 3)
ids : array of int
new_id : int
replace_events : bool
|
---|---|
Returns: | new_events: array, shape (n_events_out, 3)
|
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]])