ValueError occurs while computing spectral_connectivity_time() over epoched data

Hi,

ValueError: not enough values to unpack (expected 3, got 0)

The error with passing in data averaged over epochs occurs because spectral_connectivity_time() expects epoched data with shape (epochs x channels x times), but Epochs.average() returns an Evoked() object with data shape (channels x times).

Even without the error, estimating connectivity from a single epoch will give very noisy estimates, and I could also imagine averaging signals across epochs could lose some of the connectivity information occuring within epochs. Overall this is not the most reliable approach.

Your second approach of passing in epoched data and using average=True is definitely better (connectivity is estimated within each epoch, and then averaged over epochs).

ValueError: At least one value in n_cycles corresponds to a 
wavelet longer than the signal. Use less cycles, 
higher frequencies, or longer epochs.

The issue here comes from the fact that at least one of the Morlet wavelets being used to extract frequency information is too long. Like the error message says, you should either:

  1. Reduce the number of wavelet cycles (controlled with n_cycles, is default 7).
  2. Increase your fmin.
  3. Increase the length of your epochs (the default when calling mne.Epochs is tmin=-0.2 to tmax=0.5 w.r.t. event markers, so 0.7 s epochs).

Hope this helps!