[Mne_analysis] Getting Error: events should be a NumPy array of integers

Eric Larson larson.eric.d at gmail.com
Thu Oct 29 11:58:16 EDT 2020
Search archives:

        External Email - Use Caution        

Indeed it sounds like there is a confusion here between time in samples and
time in seconds. Have you read this tutorial? It hopefully makes the
distinction clearer:

https://mne.tools/dev/auto_tutorials/intro/plot_20_events_from_raw.html

Eric


On Thu, Oct 29, 2020 at 11:50 AM Phillip Alday <phillip.alday at mpi.nl> wrote:

>         External Email - Use Caution
>
> How are you creating the events array? The time (first) column is in
> *samples*, where are by definition always integers, not in
> (milli)seconds. If you annotations that are finer grained than samples,
> then you need to round them to your sampling resolution (also because
> there is no added value in having annotations that are finer grained
> than your EEG samples).
>
> Phillip
>
> On 29/10/20 4:37 pm, balandongiv at gmail.com wrote:
> >         External Email - Use Caution
> >
> > Dear All,
> >
> >
> >
> > We are conducting an ERP experiment. In most cases, the precision of the
> > annotation time is up to two decimal points (e.g., 358.71,1053.88).
> >
> >
> >
> > When creating an epoch using the module mne.Epochs(), the compiler
> > returns an error:
> >
> >
> >
> > TypeError: events should be a NumPy array of integers, got <class
> > 'numpy.ndarray'>
> >
> >
> >
> > Is there a way to bypass this type of error?
> >
> >
> >
> > One strategy is by round the time (e.g., 358.71,1053.88 to 359,1054).
> > However, this may reduce the overall accuracy and precision of the
> > experimentation.
> >
> >
> >
> > Appreciate for any advice.
> >
> >
> >
> > Regards
> >
> > Rpb
> >
> >
> > _______________________________________________
> > 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20201029/b0b79355/attachment-0001.html 


More information about the Mne_analysis mailing list