<div dir="ltr">Hi all,<div><br></div><div>Many thanks for all help!</div><div>I will try mne.evoked.grand_average.</div><div>Can I find it if I first get the latest code as: git clone git://<a href="http://github.com/mne-tools/mne-python.git">github.com/mne-tools/mne-python.git</a><br></div><div>and then simply type <span style="font-family:arial,sans-serif;font-size:13px">mne.evoked.grand_average ? in python?</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><font face="arial, sans-serif">Regards,</font></div><div><font face="arial, sans-serif">Maria</font></div></div><div class="gmail_extra"><br><div class="gmail_quote">2014-11-17 11:28 GMT+02:00 Mads Jensen <span dir="ltr">&lt;<a href="mailto:mje.mads@gmail.com" target="_blank">mje.mads@gmail.com</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I can give the  mne.evoked.grand_average function a try.<br>
<br>
best regards,<br>
mads<br>
<div class="HOEnZb"><div class="h5"><br>
On 17/11/14 09:21, Alexandre Gramfort wrote:<br>
&gt; hi Maria,<br>
&gt;<br>
&gt; your best option is to do a first for loop to get the list of all<br>
&gt; channels to drop,<br>
&gt; then drop them with evoked.drop_channels and then average.<br>
&gt;<br>
&gt; also pay attention to the number of epochs if it varies, as the + operator<br>
&gt; uses it.<br>
&gt;<br>
&gt; any volunteer to add a mne.evoked.grand_average function?<br>
&gt;<br>
&gt; HTH<br>
&gt; Alex<br>
&gt;<br>
&gt;<br>
&gt; On Mon, Nov 17, 2014 at 8:59 AM, Maria Hakonen &lt;<a href="mailto:maria.hakonen@gmail.com">maria.hakonen@gmail.com</a>&gt; wrote:<br>
&gt;&gt; Hi all,<br>
&gt;&gt;<br>
&gt;&gt; I have computed grand average over subjects as follows:<br>
&gt;&gt;<br>
&gt;&gt; for subject in subjects:<br>
&gt;&gt;                  evoked = mne.read_evokeds(filename, baseline=(None, 0),<br>
&gt;&gt; proj=True,verbose=False)<br>
&gt;&gt;                  if flag == 1:<br>
&gt;&gt;                          evoked_all = evoked[0]<br>
&gt;&gt;                          flag = 0<br>
&gt;&gt;                  else:<br>
&gt;&gt;                          evoked_all = evoked_all+evoked[0]<br>
&gt;&gt;          evoked_all = evoked_all / len(subjects)<br>
&gt;&gt;<br>
&gt;&gt; However, a problem arises when the evoked files don&#39;t contain the same<br>
&gt;&gt; channels (this is because I have excluded bad channels and they are not same<br>
&gt;&gt; in all files):<br>
&gt;&gt;<br>
&gt;&gt; AssertionError: &lt;Evoked  |  comment : &#39;Unknown&#39;, time : [-0.099994,<br>
&gt;&gt; 2.999808], n_epochs : 147, n_channels x n_times : 305 x 3721&gt; and &lt;Evoked  |<br>
&gt;&gt; comment : &#39;Unknown&#39;, time : [-0.099994, 2.999808], n_epochs : 154,<br>
&gt;&gt; n_channels x n_times : 306 x 3721&gt; do not contain the same channels<br>
&gt;&gt;<br>
&gt;&gt; I wonder if there is any way to get the grand average over subjects if bad<br>
&gt;&gt; channels are excluded?<br>
&gt;&gt;<br>
&gt;&gt; Many thanks already in advance!<br>
&gt;&gt;<br>
&gt;&gt; Regards,<br>
&gt;&gt; Maria<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; Mne_analysis mailing list<br>
&gt;&gt; <a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.edu</a><br>
&gt;&gt; <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; The information in this e-mail is intended only for the person to whom it is<br>
&gt;&gt; addressed. If you believe this e-mail was sent to you in error and the<br>
&gt;&gt; e-mail<br>
&gt;&gt; contains patient information, please contact the Partners Compliance<br>
&gt;&gt; HelpLine at<br>
&gt;&gt; <a href="http://www.partners.org/complianceline" target="_blank">http://www.partners.org/complianceline</a> . If the e-mail was sent to you in<br>
&gt;&gt; error<br>
&gt;&gt; but does not contain patient information, please contact the sender and<br>
&gt;&gt; properly<br>
&gt;&gt; dispose of the e-mail.<br>
&gt;&gt;<br>
&gt; _______________________________________________<br>
&gt; Mne_analysis mailing list<br>
&gt; <a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.edu</a><br>
&gt; <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
&gt;<br>
_______________________________________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" target="_blank">https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis</a><br>
</div></div></blockquote></div><br></div>