<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(['1', '2'])</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"><<a href="mailto:CCUSHING1@mgh.harvard.edu" target="_blank">CCUSHING1@mgh.harvard.edu</a>></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>
<<a href="mailto:CCUSHING1@mgh.harvard.edu">CCUSHING1@mgh.harvard.edu</a>> wrote:<br>
> Hi,<br>
><br>
> Whenever I try to use the epochs.equalize_event_counts, I get this same<br>
> error:<br>
><br>
><br>
><br>
> ###################<br>
> ----> 1 epochs.equalize_event_counts(<wbr>epochs1,epochs2)<br>
><br>
> /usr/pubsw/packages/python/<wbr>anaconda/lib/python2.7/site-<wbr>packages/mne/epochs.pyc<br>
> in equalize_event_counts(self, event_ids, method, copy)<br>
> 1619 key_match = np.zeros(epochs.events.shape[<wbr>0])<br>
> 1620 for key in eq:<br>
> -> 1621 key_match = np.logical_or(key_match,<br>
> epochs._key_match(key))<br>
> 1622 eq_inds.append(np.where(key_<wbr>match)[0])<br>
> 1623<br>
><br>
> /usr/pubsw/packages/python/<wbr>anaconda/lib/python2.7/site-<wbr>packages/mne/epochs.pyc<br>
> in _key_match(self, key)<br>
> 1323 def _key_match(self, key):<br>
> 1324 """Helper function for event dict use"""<br>
> -> 1325 if key not in self.event_id:<br>
> 1326 raise KeyError('Event "%s" is not in Epochs.' % key)<br>
> 1327 return self.events[:, 2] == self.event_id[key]<br>
><br>
> TypeError: unhashable type: 'numpy.ndarray'<br>
><br>
> ####################<br>
><br>
><br>
> This happens on my data, and the sample data, and no matter how I define my<br>
> event ids (dict or integer), so it doesn't really seem data dependent. Has<br>
> anyone encountered this before and know what is going on?<br>
><br>
> Cheers,<br>
> Cody<br>
><br>
><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<br>
> e-mail<br>
> contains patient information, please contact the Partners Compliance<br>
> 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<br>
> error<br>
> but does not contain patient information, please contact the sender and<br>
> properly<br>
> dispose of the e-mail.<br>
><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>