# convert csv file to edf file

**URL:** <https://mne.discourse.group/t/convert-csv-file-to-edf-file/6226>\
**Category:** Support & Discussions\
**Tags:** eeg, data-import\
**Created:** [January 21, 2023, 9:28am UTC](https://mne.discourse.group/t/convert-csv-file-to-edf-file/6226 "2023-01-21T09:28:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![zainab](https://avatars.discourse-cdn.com/v4/letter/z/258eb7/32.png) [@zainab](https://mne.discourse.group/u/zainab)\
**Post date:** [January 21, 2023, 9:28am UTC](https://mne.discourse.group/t/convert-csv-file-to-edf-file/6226/1 "2023-01-21T09:28:28Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![scott-huberty](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/scott-huberty/32/2715_2.png) [@scott-huberty](https://mne.discourse.group/u/scott-huberty)\
**Post date:** [January 21, 2023, 6:37pm UTC](https://mne.discourse.group/t/convert-csv-file-to-edf-file/6226/2 "2023-01-21T18:37:14Z")

</div>

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](https://mne.tools/stable/generated/mne.io.RawArray.html). Once you’ve done that, refer to the documentation for [mne.export.export\_raw](https://mne.tools/stable/generated/mne.export.export_raw.html) to export data to .edf
