Getting Error: events should be a NumPy array of integers

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

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20201029/d78341bf/attachment.html

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

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