convert csv file to edf file

How can i convert csv file to edf file using python?

Does the .csv file contain continuous EEG/MEG data, and do you plan on reading that into MNE-Python as an mne raw object ?

If so, read your .csv using the pandas library (refer to the pandas library documentation for help with this if needed), convert the pandas dataframe to a numpy array (again, referring to pandas documentation for help with this if needed), Then create an mne raw object from the numpy array with mne.io.RawArray. Once you’ve done that, refer to the documentation for mne.export.export_raw to export data to .edf

3 Likes