Combine channels based on specified channel grouping.
Raw
, Epochs
, or Evoked
An MNE-Python object to combine the channels for. The object can be of type Raw, Epochs, or Evoked.
dict
Specifies which channels are aggregated into a single channel, with
aggregation method determined by the method
parameter. One new
pseudo-channel is made per dict entry; the dict values must be lists of
picks (integer indices of ch_names
). For example:
groups=dict(Left=[1, 2, 3, 4], Right=[5, 6, 7, 8])
Note that within a dict entry all channels must have the same type.
str
| callable()
Which method to use to combine channels. If a str
, must be one
of ‘mean’, ‘median’, or ‘std’ (standard deviation). If callable, the
callable must accept one positional input (data of shape (n_channels,
n_times)
, or (n_epochs, n_channels, n_times)
) and return an
array
of shape (n_times,)
, or (n_epochs,
n_times)
. For example with an instance of Raw or Evoked:
method = lambda data: np.mean(data, axis=0)
Another example with an instance of Epochs:
method = lambda data: np.median(data, axis=1)
Defaults to 'mean'
.
If True
, include stimulus channels in the resulting object.
Defaults to False
.
If True
, drop channels marked as bad before combining. Defaults to
False
.
mne.channels.combine_channels
#EEG analysis - Event-Related Potentials (ERPs)