get an error with numpy got <class 'numpy.ndarray'>

Hi everyone,

  • MNE version: 1.0.3
  • operating system: Windows 11
  • numpy version: 1.22.4

I am trying to get the Epoch using mne.Epoch but when I use the code snippet below i get an error


infoTopo = mne.create_info(ch_names=chNames[:24], sfreq = sfreq_eeg,ch_types=“eeg”).set_montage(montage, match_case=False)

raw = mne.io.RawArray(soiFltrd[i_f][:24], infoTopo)

raw.set_eeg_reference(projection=True)

eventEEG = array([[ 0., 0., 0.], [251., 0., 1.]])
epochs = mne.Epochs(raw,eventEEG,event_id=None,firstFrame_tMap,lenSoiRaw,proj=True, picks=(“eeg”), baseline=baseline,reject=reject)


I get

events should be a NumPy array of integers, got <class ‘numpy.ndarray’>

Any help will be appreciated. Thanks

This creates an array of floats. Simply drop the periods after each number and I think it should work. Alternatively, add dtype=int to the array() call.

Best wishes,
Richard

Thanks a lot Richard. That worked. I spend hours trying to know what they issue is. However after that, I had another issue saying

“NO GRAD channel found. Cannot reject based on GRAD”.

what do you suggest I do? So I ask ask another question with this issue?

Hi, yes, please post a new question for this issue :slight_smile:

Thanks!
Richard

1 Like