<div dir="ltr">Hi,<div><br></div><div><font face="monospace, monospace">equalize_event_counts</font> takes a list of indices. So you should do <font face="monospace, monospace">epochs.equalize_event_counts([&#39;1&#39;, &#39;2&#39;])</font> instead.</div><div><br></div><div>-Jaakko</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 23, 2017 at 12:14 AM, Cushing, Cody <span dir="ltr">&lt;<a href="mailto:CCUSHING1@mgh.harvard.edu" target="_blank">CCUSHING1@mgh.harvard.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hey Alex,<br>
<br>
The attached bit of code causes the error on the sample data for me.<br>
<br>
Cheers,<br>
Cody<br>
______________________________<wbr>__________<br>
From: <a href="mailto:mne_analysis-bounces@nmr.mgh.harvard.edu">mne_analysis-bounces@nmr.mgh.<wbr>harvard.edu</a> [<a href="mailto:mne_analysis-bounces@nmr.mgh.harvard.edu">mne_analysis-bounces@nmr.mgh.<wbr>harvard.edu</a>] on behalf of Alexandre Gramfort [<a href="mailto:alexandre.gramfort@telecom-paristech.fr">alexandre.gramfort@telecom-<wbr>paristech.fr</a>]<br>
Sent: Thursday, June 22, 2017 5:47 PM<br>
To: Discussion and support forum for the users of MNE Software<br>
Subject: Re: [Mne_analysis] Equalize Event Counts Error<br>
<div class="HOEnZb"><div class="h5"><br>
Hi,<br>
<br>
Can you share a code to replicate this on the sample data?<br>
<br>
thanks<br>
Alex<br>
<br>
On Thu, Jun 22, 2017 at 8:19 PM, Cushing, Cody<br>
&lt;<a href="mailto:CCUSHING1@mgh.harvard.edu">CCUSHING1@mgh.harvard.edu</a>&gt; wrote:<br>
&gt; Hi,<br>
&gt;<br>
&gt; Whenever I try to use the epochs.equalize_event_counts, I get this same<br>
&gt; error:<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; ###################<br>
&gt; ----&gt; 1 epochs.equalize_event_counts(<wbr>epochs1,epochs2)<br>
&gt;<br>
&gt; /usr/pubsw/packages/python/<wbr>anaconda/lib/python2.7/site-<wbr>packages/mne/epochs.pyc<br>
&gt; in equalize_event_counts(self, event_ids, method, copy)<br>
&gt;    1619             key_match = np.zeros(epochs.events.shape[<wbr>0])<br>
&gt;    1620             for key in eq:<br>
&gt; -&gt; 1621                 key_match = np.logical_or(key_match,<br>
&gt; epochs._key_match(key))<br>
&gt;    1622             eq_inds.append(np.where(key_<wbr>match)[0])<br>
&gt;    1623<br>
&gt;<br>
&gt; /usr/pubsw/packages/python/<wbr>anaconda/lib/python2.7/site-<wbr>packages/mne/epochs.pyc<br>
&gt; in _key_match(self, key)<br>
&gt;    1323     def _key_match(self, key):<br>
&gt;    1324         &quot;&quot;&quot;Helper function for event dict use&quot;&quot;&quot;<br>
&gt; -&gt; 1325         if key not in self.event_id:<br>
&gt;    1326             raise KeyError(&#39;Event &quot;%s&quot; is not in Epochs.&#39; % key)<br>
&gt;    1327         return self.events[:, 2] == self.event_id[key]<br>
&gt;<br>
&gt; TypeError: unhashable type: &#39;numpy.ndarray&#39;<br>
&gt;<br>
&gt; ####################<br>
&gt;<br>
&gt;<br>
&gt; This happens on my data, and the sample data, and no matter how I define my<br>
&gt; event ids (dict or integer), so it doesn&#39;t really seem data dependent.  Has<br>
&gt; anyone encountered this before and know what is going on?<br>
&gt;<br>
&gt; Cheers,<br>
&gt; Cody<br>
&gt;<br>
&gt;<br>
&gt; ______________________________<wbr>_________________<br>
&gt; Mne_analysis mailing list<br>
&gt; <a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.<wbr>edu</a><br>
&gt; <a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.<wbr>edu/mailman/listinfo/mne_<wbr>analysis</a><br>
&gt;<br>
&gt;<br>
&gt; The information in this e-mail is intended only for the person to whom it is<br>
&gt; addressed. If you believe this e-mail was sent to you in error and the<br>
&gt; e-mail<br>
&gt; contains patient information, please contact the Partners Compliance<br>
&gt; HelpLine at<br>
&gt; <a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank">http://www.partners.org/<wbr>complianceline</a> . If the e-mail was sent to you in<br>
&gt; error<br>
&gt; but does not contain patient information, please contact the sender and<br>
&gt; properly<br>
&gt; dispose of the e-mail.<br>
&gt;<br>
______________________________<wbr>_________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.<wbr>edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.<wbr>edu/mailman/listinfo/mne_<wbr>analysis</a><br>
</div></div><br>______________________________<wbr>_________________<br>
Mne_analysis mailing list<br>
<a href="mailto:Mne_analysis@nmr.mgh.harvard.edu">Mne_analysis@nmr.mgh.harvard.<wbr>edu</a><br>
<a href="https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis" rel="noreferrer" target="_blank">https://mail.nmr.mgh.harvard.<wbr>edu/mailman/listinfo/mne_<wbr>analysis</a><br>
<br>
<br>
The information in this e-mail is intended only for the person to whom it is<br>
addressed. If you believe this e-mail was sent to you in error and the e-mail<br>
contains patient information, please contact the Partners Compliance HelpLine at<br>
<a href="http://www.partners.org/complianceline" rel="noreferrer" target="_blank">http://www.partners.org/<wbr>complianceline</a> . If the e-mail was sent to you in error<br>
but does not contain patient information, please contact the sender and properly<br>
dispose of the e-mail.<br>
<br></blockquote></div><br></div>