Hi,I want to average the data from all channels. But I only find the function that directly draws the picture.
code:
mne.viz.plot_compare_evokeds(evokeds=evoked, combine=‘mean’)
Is there any other way to directly get the average processed data of all channels?
Much appreciated
Once you have your mne.Epochs instance, e.g. epochs, you can create the evoked response with epochs.average(). This average method creates an mne.Evoked instance that contains the data averaged by channel.
Oh my bad! I misread the first post.
I don’t think there is any built-in solution in MNE. You can retrieve the underlying data array with .get_data() and then compute the mean across the channel dimension with numpy.
Just to develop on the response of @mscheltienne (assuming your Evoked data are ready and stored in erp variable):
erp_chan_avg = erp.data.mean(axis=0)
this gives you an array of channel-averages in time. If you want to perform the averaging only on a subset of channels you can use .pick_channels() before the command above, for example: