trying to import edf file using mne on linux.
See original GitHub issuePlease check the below code and suggest edit. When I run the same in windows, it works. the package versions are identical.
>>> data = mne.io.read_raw_edf('eeg1.edf',preload=True)
Extracting EDF parameters from /wsu/home/ha/ha82/ha8276/Desktop/EEG/eeg1.edf...
EDF file detected
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-11-8c2213f7e7ee> in <module>
----> 1 data = mne.io.read_raw_edf('eeg1.edf',preload=True,exclude='meas_date')
~/.local/lib/python3.7/site-packages/mne/io/edf/edf.py in read_raw_edf(input_fname, eog, misc, stim_channel, exclude, preload, verbose)
1179 return RawEDF(input_fname=input_fname, eog=eog, misc=misc,
1180 stim_channel=stim_channel, exclude=exclude, preload=preload,
-> 1181 verbose=verbose)
1182
1183
<decorator-gen-163> in __init__(self, input_fname, eog, misc, stim_channel, exclude, preload, verbose)
~/.local/lib/python3.7/site-packages/mne/io/edf/edf.py in __init__(self, input_fname, eog, misc, stim_channel, exclude, preload, verbose)
113 info, edf_info, orig_units = _get_info(input_fname,
114 stim_channel, eog, misc,
--> 115 exclude, preload)
116 logger.info('Creating raw.info structure...')
117
~/.local/lib/python3.7/site-packages/mne/io/edf/edf.py in _get_info(fname, stim_channel, eog, misc, exclude, preload)
375 misc = misc if misc is not None else []
376
--> 377 edf_info, orig_units = _read_header(fname, exclude)
378
379 # XXX: `tal_ch_names` to pass to `_check_stim_channel` should be computed
~/.local/lib/python3.7/site-packages/mne/io/edf/edf.py in _read_header(fname, exclude)
362 logger.info('%s file detected' % ext.upper())
363 if ext in ('bdf', 'edf'):
--> 364 return _read_edf_header(fname, exclude)
365 elif ext in ('gdf'):
366 return _read_gdf_header(fname, exclude), None
~/.local/lib/python3.7/site-packages/mne/io/edf/edf.py in _read_edf_header(fname, exclude)
543 century = 2000 if year < 50 else 1900
544 meas_date = datetime(year + century, month, day, hour, minute, sec,
--> 545 tzinfo=timezone.utc)
546
547 header_nbytes = int(fid.read(8).decode())
ValueError: month must be in 1..12
Issue Analytics
- State:
- Created 3 years ago
- Comments:17 (9 by maintainers)
Top Results From Across the Web
problems when loading edf file · Issue #6091 · mne ... - GitHub
I lose the miliseconds in raw.info['meas_date'] (despite being in the file); when I do mne.find_events(raw) (when stim_channel is present) I get ...
Read more >mne.io.read_raw_edf — MNE 1.2.2 documentation
Reader function for EDF or EDF+ files. ... If True, try to infer channel types from channel labels. If a channel label starts...
Read more >Getting error to read edf file using mne-python - Stack Overflow
Better you try to be in the exact directory and try reading the file, i.e go to your home directory and then try...
Read more >EDF downloads - European Data Format
This page aims to list all freely available EDF(+) files and software, ... If you want to try it, just start with the...
Read more >How to read edf data in Python 3 - Intellipaat Community
Try using MNE library. Try the below code: import mne. file = "my_path\\my_file.edf". data = mne.io.read_raw_edf(file).
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I figured it out. there were some issues with the edf files I downloaded. Works fine with another batch of files. Thank you are all the help
This is still the logical next step in debugging, and since none of us can replicate your error, you’ll need to do this yourself @harmeet9307
Since it looks like you’re not using ipython, the equivalent of
%debug
would beimport pdb; pdb.pm()
to enter the debugger immediately after the error occurs. from there you should be able to view the values of the variablesyear
,month
, etc.