0

我是 MNE 和 python 编程的新手,当我试图打开以 edf 格式提供给我的原始文件时,我遇到了给定的问题。谁能帮我解决给定的问题。任何帮助将不胜感激。

我在下面分享错误:

EDF file detected
---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_8820/3021964063.py in <module>
----> 1 raw=mne.io.read_raw_edf(fname)

~\Anaconda3\envs\mne\lib\site-packages\mne\io\edf\edf.py in read_raw_edf(input_fname, eog, misc, stim_channel, exclude, preload, verbose)
   1325     if ext != 'edf':
   1326         raise NotImplementedError(f'Only EDF files are supported, got {ext}.')
-> 1327     return RawEDF(input_fname=input_fname, eog=eog, misc=misc,
   1328                   stim_channel=stim_channel, exclude=exclude, preload=preload,
   1329                   verbose=verbose)

<decorator-gen-215> in __init__(self, input_fname, eog, misc, stim_channel, exclude, preload, verbose)

~\Anaconda3\envs\mne\lib\site-packages\mne\io\edf\edf.py in __init__(self, input_fname, eog, misc, stim_channel, exclude, preload, verbose)
    112         logger.info('Extracting EDF parameters from {}...'.format(input_fname))
    113         input_fname = os.path.abspath(input_fname)
--> 114         info, edf_info, orig_units = _get_info(input_fname, stim_channel, eog,
    115                                                misc, exclude, preload)
    116         logger.info('Creating raw.info structure...')

~\Anaconda3\envs\mne\lib\site-packages\mne\io\edf\edf.py in _get_info(fname, stim_channel, eog, misc, exclude, preload)
    355     misc = misc if misc is not None else []
    356 
--> 357     edf_info, orig_units = _read_header(fname, exclude)
    358 
    359     # XXX: `tal_ch_names` to pass to `_check_stim_channel` should be computed

~\Anaconda3\envs\mne\lib\site-packages\mne\io\edf\edf.py in _read_header(fname, exclude)
    342     logger.info('%s file detected' % ext.upper())
    343     if ext in ('bdf', 'edf'):
--> 344         return _read_edf_header(fname, exclude)
    345     elif ext == 'gdf':
    346         return _read_gdf_header(fname, exclude), None

~\Anaconda3\envs\mne\lib\site-packages\mne\io\edf\edf.py in _read_edf_header(fname, exclude)
    707 
    708         physical_min = np.array(
--> 709             [float(_edf_str(fid.read(8))) for ch in channels])[sel]
    710         physical_max = np.array(
    711             [float(_edf_str(fid.read(8))) for ch in channels])[sel]

~\Anaconda3\envs\mne\lib\site-packages\mne\io\edf\edf.py in <listcomp>(.0)
    707 
    708         physical_min = np.array(
--> 709             [float(_edf_str(fid.read(8))) for ch in channels])[sel]
    710         physical_max = np.array(
    711             [float(_edf_str(fid.read(8))) for ch in channels])[sel]

ValueError: could not convert string to float: '-7.2147e'```
4

0 回答 0