- MNE version: 1.7.1
- operating system: Windows 10
Hi,
I am very new to MNE, so I apologise if this is an elementary question.
I was trying to epoch EEG data based on three stimuli types, meaning there are three event_id. I want to epoch the data as below:
if event_id = 1, tmin = -1, tmax = 42
if event_id = 2/3, tmin = -1, tmax = 7
Besides, the order of the appearance of stimuli was: 1,1,1,1,2,3,2,3 (just a short version example).
I want to get a whole epoched data with the mne.epochs() and mne.concatenate_epochs(). Below is my code:
for i in events_ica_subj13[:, 2]:
if i == 1:
epochs_encode_subj13 = mne.Epochs(raw_eeg_subj13_1Hz_notch2, events_ica_subj13,
event_id = i,
tmin = -1, tmax = 42,
baseline = (None, None),
preload = True)
elif i == 2:
epochs_retr_audio_subj13 = mne.Epochs(raw_eeg_subj13_1Hz_notch2, events_ica_subj13,
event_id = i,
tmin = -1, tmax = 7,
baseline = (None, None),
preload = True)
else:
epochs_retr_pic_subj13 = mne.Epochs(raw_eeg_subj13_1Hz_notch2, events_ica_subj13,
event_id = 3,
tmin = -1, tmax = 7,
baseline = (None, None),
preload = True)
This part can work. But when I add mne.concatenate_epochs(), it returns an error as below:
epochs_ica_subj13_01Hz = mne.concatenate_epochs([epochs_encode_subj13,
epochs_retr_audio_subj13,
epochs_retr_pic_subj13])
Error message:
operands could not be broadcast together with shapes (4097,) (22017,)
I have read about other discussions that this error might be due to the different lengths of the epochs, in my case, 43 and 8. However, since the experimental design is like this, are there any solutions to this problem?
PS. I also tried the numpy.concatenate() method in this link but also failed…
Thank you very much for your help!
Yi