<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_1002122950239893821m_3920726994540838941m_-619153119897050942gmail-HOEnZb"><div class="m_1002122950239893821m_3920726994540838941m_-619153119897050942gmail-h5"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p class="MsoNormal">data=np.concatenate((epochs_1.<wbr>get_data(),epochs_2.get_data()<wbr>),axis=0)<br></p>

<p class="MsoNormal"><span lang="EN-US">data.shape<span></span></span></p>

<p class="MsoNormal"><span lang="EN-US">Out[28]:
(320, 308, 3721)</span></p></div></blockquote></div></div></div></div></blockquote><div><br></div><div>Following the nomenclature from the <a href="https://mne-tools.github.io/stable/generated/mne.connectivity.spectral_connectivity.html#mne.connectivity.spectral_connectivity" target="_blank">connectivity docs</a>, your input data need to be formatted as (n_epochs, n_signals, n_times). Keep in mind that the n_signals dimension is usually the spatial one, like source space vertices, or in your case, channels. So the way you have this set up, you have 308 spatial channels / signals, each with 320 epochs / repeats.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_1002122950239893821m_3920726994540838941m_-619153119897050942gmail-HOEnZb"><div class="m_1002122950239893821m_3920726994540838941m_-619153119897050942gmail-h5"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">

<p class="MsoNormal"><span lang="EN-US">I am not
sure how the parameter “indices” should be set in my case.</span></p></div></blockquote></div></div></div></div></blockquote><div><br></div><div>Indices should be into the (typically) spatial dimension, i.e. the n_signals dimension.</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_1002122950239893821m_3920726994540838941m_-619153119897050942gmail-HOEnZb"><div class="m_1002122950239893821m_3920726994540838941m_-619153119897050942gmail-h5"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p class="MsoNormal"><span lang="EN-US">I would like to
calculate the coherence between each data point in the file 1 and the corresponding
data points in the file 2.</span></p></div></blockquote></div></div></div></div></blockquote><div><br></div><div>&quot;data point&quot; is a bit ambiguous -- I assume you mean you want to estimate the connectivity between <i>each channel</i> from the first dataset and <i>each channel</i> in the second dataset....</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div class="m_1002122950239893821m_3920726994540838941m_-619153119897050942gmail-HOEnZb"><div class="m_1002122950239893821m_3920726994540838941m_-619153119897050942gmail-h5"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr"><p class="MsoNormal"><span lang="EN-US">Since I have 320 epochs after concatenation, I tried:<span></span></span></p>

<p class="MsoNormal"><span lang="EN-US">indices=(np.arange(1,160),np.a<wbr>range(161,320))
(i.e. 160 epochs in each file).</span></p></div></blockquote></div></div></div></div></blockquote><div> </div><div>... which means this probably isn&#39;t set up to do what you want.</div><div><br></div><div>What you might want is this:</div><div class="m_1002122950239893821m_3920726994540838941m_-619153119897050942gmail-markdown-here-wrapper"><pre style="line-height:1.2em;margin:1.2em 0px"><code><span style="font-family:Consolas,Inconsolata,Courier,monospace;font-size:0.85em;margin:0px 0.15em;background-color:rgb(248,248,248);white-space:pre-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block">data=np.concatenate((epochs_1.<wbr>get_data(),epochs_2.get_data()<wbr>),axis=1)
data.shape
(160, 616, 3721)</span></code></pre><div title="MDH:PGRpdj5gYGA8L2Rpdj48ZGl2PjxzcGFuIHN0eWxlPSJjb2xvcjogcmdiKDgwLCAwLCA4MCk7Ij5k
YXRhPW5wLmNvbmNhdGVuYXRlKChlcG9jaHNfMS48L3NwYW4+PHdiciBzdHlsZT0iY29sb3I6IHJn
Yig4MCwgMCwgODApOyI+PHNwYW4gc3R5bGU9ImNvbG9yOiByZ2IoODAsIDAsIDgwKTsiPmdldF9k
YXRhKCksZXBvY2hzXzIuZ2V0X2RhdGEoKTwvc3Bhbj48d2JyIHN0eWxlPSJjb2xvcjogcmdiKDgw
LCAwLCA4MCk7Ij48c3BhbiBzdHlsZT0iY29sb3I6IHJnYig4MCwgMCwgODApOyI+KSxheGlzPTEp
PC9zcGFuPjxicj48L2Rpdj48ZGl2PjxzcGFuIHN0eWxlPSJjb2xvcjogcmdiKDgwLCAwLCA4MCk7
Ij5kYXRhLnNoYXBlPC9zcGFuPjwvZGl2PjxkaXY+PHNwYW4gc3R5bGU9ImNvbG9yOiByZ2IoODAs
IDAsIDgwKTsiPigxNjAsIDYxNiwzNzIxKTwvc3Bhbj48L2Rpdj48ZGl2PjxzcGFuIHN0eWxlPSJj
b2xvcjogcmdiKDgwLCAwLCA4MCk7Ij5gYGA8L3NwYW4+PC9kaXY+PGRpdj48L2Rpdj4=" style="height:0px;width:0px;max-height:0px;max-width:0px;overflow:hidden;padding:0px;margin:0px">​</div></div>This way, you have 616 signals of interest (308 signals / channels from one condition, 308 from signals / channels from another), each with 160 epochs / repeats.</div><div class="gmail_quote"><br></div><div class="gmail_quote"><div>Hopefully from there you can come up with how to get connectivity you want. For example, if you want each channel only with its corresponding channel from the other condition (308 estimates), this would be something like:</div><div></div><div class="m_1002122950239893821m_3920726994540838941m_-619153119897050942markdown-here-wrapper"><pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important">(np.arange(308), np.arange(308) + 308)
</code></pre><div title="MDH:PGRpdj5gYGA8L2Rpdj48ZGl2PihucC5hcmFuZ2UoMzA4KSwgbnAuYXJhbmdlKDMwOCkgKyAzMDgp
PC9kaXY+PGRpdj5gYGA8L2Rpdj48ZGl2PjwvZGl2Pg==" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0">​</div></div><div>If you wanted all channels from condition 1 with all channels from condition 2 (94864 estimates), this would be something like:<br></div><div></div><div class="m_1002122950239893821m_3920726994540838941m_-619153119897050942markdown-here-wrapper"><pre style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;font-size:1em;line-height:1.2em;margin:1.2em 0px"><code style="font-size:0.85em;font-family:Consolas,Inconsolata,Courier,monospace;margin:0px 0.15em;padding:0px 0.3em;white-space:pre-wrap;border:1px solid rgb(234,234,234);background-color:rgb(248,248,248);border-radius:3px;display:inline;white-space:pre-wrap;overflow:auto;border-radius:3px;border:1px solid rgb(204,204,204);padding:0.5em 0.7em;display:block!important">(np.repeat(np.arange(308), 308), np.tile(np.arange(308) + 308, 308))
</code></pre><div title="MDH:PGRpdj5gYGA8L2Rpdj48ZGl2Pm5wLnJlcGVhdChucC5hcmFuZ2UoMzA4KSwgMzA4KSwgbnAudGls
ZShucC5hcmFuZ2UoMzA4KSArIDMwOCwgMzA4KTxicj48L2Rpdj48ZGl2PmBgYDwvZGl2PjxkaXY+
PC9kaXY+" style="height:0;width:0;max-height:0;max-width:0;overflow:hidden;font-size:0em;padding:0;margin:0">​</div></div><div>And 308 is a somewhat rare number of data channels -- you might want to check to make sure you have only data channels picked as Jaakko suggests.</div><div><br></div><div>HTH,<br></div><div>Eric</div><div><br></div></div></div></div>