python-3.xeuropean-data-formatmne-python

Getting error to read edf file using mne-python


I am trying to visualize the EEG data fie which is in .edf file format.For this purpose I am using MNE python. here is my code

import mne
file = "/home/test.edf"
data = mne.io.read_raw_edf(file,preload=True)

Whenever I run this code below error massage is showing

ValueError: not enough values to unpack (expected 3, got 0)

I could not figure out where is my wrong.


Solution

  • It's not possible to use use the file by specifying the path, event if you add a "~", the directory won't be identified. Better you try to be in the exact directory and try reading the file, i.e go to your home directory and then try specifying the file.

    import mne
    file = "test.edf"
    data = mne.io.read_raw_edf(file)