# error while computing source space connectivity

**URL:** <https://mne.discourse.group/t/error-while-computing-source-space-connectivity/957>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [January 29, 2016, 10:05pm UTC](https://mne.discourse.group/t/error-while-computing-source-space-connectivity/957 "2016-01-29T22:05:33Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [January 29, 2016, 10:05pm UTC](https://mne.discourse.group/t/error-while-computing-source-space-connectivity/957/1 "2016-01-29T22:05:33Z")

</div>

Dear MNE experts,

I am a MEG beginner. I just started to calculate source space connectivity using the following scripts from the MNE website:

[http://martinos.org/mne/stable/auto\_examples/connectivity/plot\_mne\_inverse\_label\_connectivity.html#sphx-glr-auto-examples-co](http://martinos.org/mne/stable/auto_examples/connectivity/plot_mne_inverse_label_connectivity.html#sphx-glr-auto-examples-co)

I downloaded the .py file and made some modifications according to my MEG data. I succeeded with loading the raw, events and the inverse\_operator files. The picks and epochs also seem to be correct. However, when I tried to calculate connectivity (using the spectral\_connectivity function), I got the following error message:

/usr/pubsw/packages/python/anaconda/lib/python2.7/site-packages/mne/connectivity/spectral.pyc in spectral\_connectivity(data, method, indices, sfreq, mode, fmin, fmax, fskip, faverage, tmin, tmax, mt\_bandwidth, mt\_adaptive, mt\_low\_bias, cwt\_frequencies, cwt\_n\_cycles, block\_size, n\_jobs, verbose)  
&nbsp;&nbsp;&nbsp;&nbsp;769 if epoch\_idx == 0:  
&nbsp;&nbsp;&nbsp;&nbsp;770 # initialize everything  
--\> 771 first\_epoch = epoch\_block[0]  
&nbsp;&nbsp;&nbsp;&nbsp;772  
&nbsp;&nbsp;&nbsp;&nbsp;773 # get the data size and time scale

IndexError: list index out of range

I checked the label\_ts variable, it seems like this:

\<generator object \_gen\_extract\_label\_time\_course at 0x2ba48c651a00\>

So could someone please help me with this problem?

Best wishes,  
Baojuan  
\<[http://martinos.org/mne/stable/generated/mne.connectivity.spectral\_connectivity.html#mne.connectivity.spectral\_connectivity](http://martinos.org/mne/stable/generated/mne.connectivity.spectral_connectivity.html#mne.connectivity.spectral_connectivity)\>  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20160129/43d34e6b/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20160129/43d34e6b/attachment.html)
