[Mne_analysis] Equalize Event Counts Error

Jaakko Leppakangas jaeilepp at gmail.com
Fri Jun 23 02:12:38 EDT 2017
Search archives:

Hi,

equalize_event_counts takes a list of indices. So you should do
epochs.equalize_event_counts(['1',
'2']) instead.

-Jaakko

On Fri, Jun 23, 2017 at 12:14 AM, Cushing, Cody <CCUSHING1 at mgh.harvard.edu>
wrote:

> Hey Alex,
>
> The attached bit of code causes the error on the sample data for me.
>
> Cheers,
> Cody
> ________________________________________
> From: mne_analysis-bounces at nmr.mgh.harvard.edu [
> mne_analysis-bounces at nmr.mgh.harvard.edu] on behalf of Alexandre Gramfort
> [alexandre.gramfort at telecom-paristech.fr]
> Sent: Thursday, June 22, 2017 5:47 PM
> To: Discussion and support forum for the users of MNE Software
> Subject: Re: [Mne_analysis] Equalize Event Counts Error
>
> Hi,
>
> Can you share a code to replicate this on the sample data?
>
> thanks
> Alex
>
> On Thu, Jun 22, 2017 at 8:19 PM, Cushing, Cody
> <CCUSHING1 at mgh.harvard.edu> wrote:
> > Hi,
> >
> > Whenever I try to use the epochs.equalize_event_counts, I get this same
> > error:
> >
> >
> >
> > ###################
> > ----> 1 epochs.equalize_event_counts(epochs1,epochs2)
> >
> > /usr/pubsw/packages/python/anaconda/lib/python2.7/site-
> packages/mne/epochs.pyc
> > in equalize_event_counts(self, event_ids, method, copy)
> >    1619             key_match = np.zeros(epochs.events.shape[0])
> >    1620             for key in eq:
> > -> 1621                 key_match = np.logical_or(key_match,
> > epochs._key_match(key))
> >    1622             eq_inds.append(np.where(key_match)[0])
> >    1623
> >
> > /usr/pubsw/packages/python/anaconda/lib/python2.7/site-
> packages/mne/epochs.pyc
> > in _key_match(self, key)
> >    1323     def _key_match(self, key):
> >    1324         """Helper function for event dict use"""
> > -> 1325         if key not in self.event_id:
> >    1326             raise KeyError('Event "%s" is not in Epochs.' % key)
> >    1327         return self.events[:, 2] == self.event_id[key]
> >
> > TypeError: unhashable type: 'numpy.ndarray'
> >
> > ####################
> >
> >
> > This happens on my data, and the sample data, and no matter how I define
> my
> > event ids (dict or integer), so it doesn't really seem data dependent.
> Has
> > anyone encountered this before and know what is going on?
> >
> > Cheers,
> > Cody
> >
> >
> > _______________________________________________
> > Mne_analysis mailing list
> > Mne_analysis at nmr.mgh.harvard.edu
> > https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
> >
> >
> > The information in this e-mail is intended only for the person to whom
> it is
> > addressed. If you believe this e-mail was sent to you in error and the
> > e-mail
> > contains patient information, please contact the Partners Compliance
> > HelpLine at
> > http://www.partners.org/complianceline . If the e-mail was sent to you
> in
> > error
> > but does not contain patient information, please contact the sender and
> > properly
> > dispose of the e-mail.
> >
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
> _______________________________________________
> Mne_analysis mailing list
> Mne_analysis at nmr.mgh.harvard.edu
> https://mail.nmr.mgh.harvard.edu/mailman/listinfo/mne_analysis
>
>
> The information in this e-mail is intended only for the person to whom it
> is
> addressed. If you believe this e-mail was sent to you in error and the
> e-mail
> contains patient information, please contact the Partners Compliance
> HelpLine at
> http://www.partners.org/complianceline . If the e-mail was sent to you in
> error
> but does not contain patient information, please contact the sender and
> properly
> dispose of the e-mail.
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20170623/c0ec5102/attachment-0001.html 


More information about the Mne_analysis mailing list