我试图运行这 3 行代码:
import mne
myfile = 'test_raw.fif'
raw = mne.io.read_raw_fif(myfile)
它应该加载一个 .fif-File 它的示例来自http://martinos.org/mne/stable/index.html
当我使用他们的示例数据尝试它时,它可以工作!当我用自己的记录数据运行它时,我得到了这个错误堆栈:
> runfile('C:/Felix/Uni/Bachelorarbeit/mne/untitled2.py',
> wdir='C:/Felix/Uni/Bachelorarbeit/mne') Opening raw data file
> C:\Felix\Uni\Bachelorarbeit\mne\test_raw.fif... Traceback (most recent
> call last): File "<stdin>", line 1, in <module> File
> "C:\Users\Felix\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py",
> line 866, in runfile
> execfile(filename, namespace) File "C:\Users\Felix\Anaconda2\lib\site-packages\spyder\utils\site\sitecustomize.py",
> line 87, in execfile
> exec(compile(scripttext, filename, 'exec'), glob, loc) File "C:/Felix/Uni/Bachelorarbeit/mne/untitled2.py", line 4, in <module>
> raw = mne.io.read_raw_fif(myfile) File "C:\Users\Felix\Anaconda2\lib\site-packages\mne\io\fiff\raw.py", line
> 519, in read_raw_fif
> add_eeg_ref=add_eeg_ref, fnames=fnames, verbose=verbose) File "<string>", line 2, in __init__ File
> "C:\Users\Felix\Anaconda2\lib\site-packages\mne\utils.py", line 708,
> in verbose
> return function(*args, **kwargs) File "C:\Users\Felix\Anaconda2\lib\site-packages\mne\io\fiff\raw.py", line
> 109, in __init__
> preload, do_check_fname) File "<string>", line 2, in _read_raw_file File "C:\Users\Felix\Anaconda2\lib\site-packages\mne\utils.py", line 708,
> in verbose
> return function(*args, **kwargs) File "C:\Users\Felix\Anaconda2\lib\site-packages\mne\io\fiff\raw.py", line
> 186, in _read_raw_file
> ff, tree, _ = fiff_open(fname, preload=whole_file) File "<string>", line 2, in fiff_open File
> "C:\Users\Felix\Anaconda2\lib\site-packages\mne\utils.py", line 708,
> in verbose
> return function(*args, **kwargs) File "C:\Users\Felix\Anaconda2\lib\site-packages\mne\io\open.py", line 146,
> in fiff_open
> tree, _ = make_dir_tree(fid, directory) File "<string>", line 2, in make_dir_tree File
> "C:\Users\Felix\Anaconda2\lib\site-packages\mne\utils.py", line 708,
> in verbose
> return function(*args, **kwargs) File "C:\Users\Felix\Anaconda2\lib\site-packages\mne\io\tree.py", line 56,
> in make_dir_tree
> if directory[start].kind == FIFF_BLOCK_START: TypeError: 'NoneType' object has no attribute '__getitem__'
我下载了“头脑风暴”,它可以说明 .fif 文件。可以显示来自 MNE 的 Sampledate。如果我尝试我的,他们不会。
:/