I wanted to concatenate two epochs with different lengths using the function mne.concatenate_epochs. Unfortunately, that didn’t work and I obtained that error: ValueError: operands could not be broadcast together with shapes (601,) (1751,)
Then, I thought I could get around this limitation by giving the epochs the same lengths. That didn’t work either; I received this error: ValueError: Epochs must have same times
To conclude, maybe I could give the big picture in case another option could give me what I want in the end. I try to exclude a time period inside an epoch. My strategy was to create two epochs using the same time event but with different tmin and tmax. Then, I expected to just concatenate the two epochs.
MNE enforces epochs to have the same length. If you enforce each epochs to
have the same tmin, tmax and sfreq you should not have a any problem
with concatenate_epochs function.
MNE now has epoch annotations, so you could first epoch and then annotate the segment you would like to be omitted with an annotation with description starting with ‘bad’. The approach with concatenating that you use introduces discontinuities in the data and is not optimal.