question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Problem with load eeglab file

See original GitHub issue

Hi everyone! I have problem with loading data. I have eeglab files (example: https://ufile.io/f/js83q) and after using mne.io.read_raw_eeglab I get: Reading rest1_1_trigg.fdt

TypeError Traceback (most recent call last)
TypeError: only size-1 arrays can be converted to Python scalars

The above exception was the direct cause of the following exception:

ValueError Traceback (most recent call last)

<ipython-input-20-49d5d8853521> in <module>
----> 1 mne.io.read_raw_eeglab(os.path.join(folder_with_data, files_all[0]))

~.conda\envs\mne\lib\site-packages\mne\io\eeglab\eeglab.py in read_raw_eeglab(input_fname, eog, preload, uint16_codec, verbose)
219 .. versionadded:: 0.11.0
220 """
--> 221 return RawEEGLAB(input_fname=input_fname, preload=preload,
222 eog=eog, verbose=verbose, uint16_codec=uint16_codec)
223

<decorator-gen-197> in init(self, input_fname, eog, preload, uint16_codec, verbose)

~.conda\envs\mne\lib\site-packages\mne\io\eeglab\eeglab.py in init(self, input_fname, eog, preload, uint16_codec, verbose)
353
354 # create event_ch from annotations
--> 355 annot = read_annotations(input_fname)
356 self.set_annotations(annot)
357 _check_boundary(annot, None)

~.conda\envs\mne\lib\site-packages\mne\annotations.py in read_annotations(fname, sfreq, uint16_codec)
665
666 elif name.endswith('set'):
--> 667 annotations = _read_annotations_eeglab(fname,
668 uint16_codec=uint16_codec)
669

~.conda\envs\mne\lib\site-packages\mne\io\eeglab\eeglab.py in _read_annotations_eeglab(eeg, uint16_codec)
611 duration = np.zeros(len(onset))
612 if len(events) > 0 and hasattr(events[0], 'duration'):
--> 613 duration[:] = [event.duration for event in events]
614
615 return Annotations(onset=np.array(onset) / eeg.srate,

ValueError: setting an array element with a sequence.

I am using version 0.20.8 of mne and Python 3.8.5. Can you help me with this problem?

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
mmagnuskicommented, Oct 19, 2020

Hi @ociepkam I can confirm the problem, I’ll take a look at it.

0reactions
mmagnuskicommented, Oct 19, 2020

@ociepkam Ok, good, then see if the fix I pushed (see the PR linked above) works for you. For me it fixes the problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

[Eeglablist] eeglab can't load bdf files
Hello, this is unusual problem as bdf files should load easily in eeglab in my experience. 1. Try other import functions, ...
Read more >
cannot load the file in EEGLAB - MATLAB Answers - MathWorks
I failed to read one of EEG files in MATLAB. The error message popped up that "no such file or directory (error occurred...
Read more >
Some problem about importing .set file from EEGLAB #5359
I want to use mne.io.read_raw_eeglab to import .set file from eeglab. However, it always report error with "No such file or directory: ...
Read more >
How to solve this problem with data import into EEGLAB?
I am facing a peculiar problem while importing .mat and .raw file into EEGLAB. When I import data using .mat file then the...
Read more >
Problem with importing epochs from eeglab to brainstorm - Bugs
I looked at your files, and they load nicely as [-4s, +8s] epochs. This works both with the menus "Review raw file" or...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found