1

Absolute noob here with EEG analysis. I used the following code to read one subject successfully:

import mne
file = "my_path\\my_file.edf"
data = mne.io.read_raw_edf(file)
raw_data = data.get_data()
channels = data.ch_names

This works perfectly fine. But my intention is to follow along the MNE-python documentation from this link where they use raws = [read_raw_edf(f, preload=True) for f in raw_fnames]

I have a dataset of 25 subjects, all in one directory and with .edf extension. I am trying to append all the rows from all these tables and I cant get this to work. Please any light on this?

1 Answers1

0

although it over a year since you asked, but I have a solution for this question.
In a python environment, in a path with many edf or any related files, you can load them using this code.

    from mne.io import read_raw_edf, concatenate_raws  

    data = edf_batch_loader(path)  
    
    path = ['my_file1.edf', 'my_file2.edf']
    raws = [read_raw_edf(file, preload=True) for file in path]  
    data = concatenate_raws(raws)  

Note that the PATH should be a list containing all the filenames of the edf files for this to work

Miracle
  • 1
  • 1