Hi, I’m new to MNE and I’ve been having issues loading data with the newer versions of MNE. At first I thought it was something in the formatting of my data (from Emotiv Epoch) despite it being perfectly readable with edfbrowser, so I downloaded a toy file from edfbrowser, but I keep getting the same issues.
- MNE-Python version >= 0.23.0
- numpy version: same behavior with numpy-1.21.4, numpy-1.20.3
- operating system: OSX 12.0.1
Behavior with versions >= 0.23.0
:
>>> import mne
>>> mne.__version__
'0.23.0'
>>> mne.io.read_raw_edf("/Users/neako/Downloads/eeg_recording/ma0844az_1-1+.edf")
Extracting EDF parameters from /Users/neako/Downloads/eeg_recording/ma0844az_1-1+.edf...
EDF file detected
Setting channel info structure...
Creating raw.info structure...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/neako/anaconda3/lib/python3.7/site-packages/mne/io/edf/edf.py", line 1222, in read_raw_edf
verbose=verbose)
File "<decorator-gen-197>", line 24, in __init__
File "/Users/neako/anaconda3/lib/python3.7/site-packages/mne/io/edf/edf.py", line 137, in __init__
description=desc, orig_time=None))
File "<decorator-gen-183>", line 24, in set_annotations
File "/Users/neako/anaconda3/lib/python3.7/site-packages/mne/io/base.py", line 661, in set_annotations
new_annotations.crop(0, self.times[-1] + delta,
File "/Users/neako/anaconda3/lib/python3.7/site-packages/mne/io/base.py", line 1580, in times
out = _arange_div(self.n_times, float(self.info['sfreq']))
TypeError: expected dtype object, got 'numpy.dtype[float64]'
Previous behavior: there was an issue when using the function read_info
but it wasn’t blocking the reading of data, info was still read when reading the file. Also the error is different.
>>> import mne
>>> mne.__version__
'0.22.1'
>>> mne.io.read_info("/Users/neako/Downloads/eeg_recording/ma0844az_1-1+.edf")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<decorator-gen-25>", line 24, in read_info
File "/Users/neako/anaconda3/lib/python3.7/site-packages/mne/io/meas_info.py", line 917, in read_info
f, tree, _ = fiff_open(fname)
File "<decorator-gen-6>", line 24, in fiff_open
File "/Users/neako/anaconda3/lib/python3.7/site-packages/mne/io/open.py", line 127, in fiff_open
return _fiff_open(fname, fid, preload)
File "/Users/neako/anaconda3/lib/python3.7/site-packages/mne/io/open.py", line 145, in _fiff_open
raise ValueError('file does not start with a file id tag')
ValueError: file does not start with a file id tag
>>> s = mne.io.read_raw_edf("/Users/neako/Downloads/eeg_recording/ma0844az_1-1+.edf", preload=True)
Extracting EDF parameters from /Users/neako/Downloads/eeg_recording/ma0844az_1-1+.edf...
EDF file detected
Setting channel info structure...
Creating raw.info structure...
Reading 0 ... 363619 = 0.000 ... 1818.095 secs...
>>> s.info
<Info | 7 non-empty values
bads: []
ch_names: EEG FP1, EEG FP2, EEG F3, EEG F4, EEG C3, EEG C4, EEG P3, EEG ...
chs: 37 EEG
custom_ref_applied: False
highpass: 0.0 Hz
lowpass: 100.0 Hz
meas_date: 2005-09-15 10:18:42 UTC
nchan: 37
projs: []
sfreq: 200.0 Hz
>