# Mne.io.read\_raw\_edf

**URL:** <https://mne.discourse.group/t/mne-io-read-raw-edf/2428>\
**Category:** Support & Discussions\
**Tags:** eeg, machine-learning\
**Created:** [January 4, 2021, 12:58pm UTC](https://mne.discourse.group/t/mne-io-read-raw-edf/2428 "2021-01-04T12:58:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![t\_mne2021](https://avatars.discourse-cdn.com/v4/letter/t/c6cbf5/32.png) [@t\_mne2021](https://mne.discourse.group/u/t_mne2021)\
**Post date:** [January 4, 2021, 12:58pm UTC](https://mne.discourse.group/t/mne-io-read-raw-edf/2428/1 "2021-01-04T12:58:20Z")

</div>

I recently encountered a problem when loading the MASS dataset using the mne tool. Because the sampling frequency of some subjects in the MASS data set is different, the data of all channels will be resampled to the same as the first channel when the read\_raw\_edf function is used. I don’t want automatic resampling. I want to keep the original data dimensions. How can I turn off automatic resampling?

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [January 4, 2021, 4:08pm UTC](https://mne.discourse.group/t/mne-io-read-raw-edf/2428/2 "2021-01-04T16:08:54Z")

</div>

the only way to do this with MNE is to pick the channels you want to read. So read only the channels you don’t want to resample by using _exclude_ param to exclude the channels you don’t want.

let me know if it’s not clear enough

Alex

---

<div class="post-metadata">

**Author:** ![t\_mne2021](https://avatars.discourse-cdn.com/v4/letter/t/c6cbf5/32.png) [@t\_mne2021](https://mne.discourse.group/u/t_mne2021)\
**Post date:** [January 5, 2021, 3:02am UTC](https://mne.discourse.group/t/mne-io-read-raw-edf/2428/3 "2021-01-05T03:02:03Z")

</div>

Hi, Mr.Alex  
Thank you very much for your answer. I know that there is a keyword ‘exclude’ in the read\_raw\_edf function. But my model needs to use data from all channels. Therefore no channels can be ruled out. I want to modify edf.py to change the default usage of read\_raw\_edf, but I keep reporting errors. If there is no other solution, I think this is an idea to improve mne tool.

Tian

Alexandre Gramfort via MNE Forum \<[mne@discoursemail.com](mailto:mne@discoursemail.com)\> 于2021年1月5日周二 上午12:18写道：

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [January 5, 2021, 8:15pm UTC](https://mne.discourse.group/t/mne-io-read-raw-edf/2428/4 "2021-01-05T20:15:34Z")

</div>

MNE only works with channels having the same sampling rate. So would need to read channels separately. Sorry no other way.

It’s what we did in this paper : [https://arxiv.org/abs/1707.03321](https://arxiv.org/abs/1707.03321) using MASS dataset.

Alex

---

<div class="post-metadata">

**Author:** ![t\_mne2021](https://avatars.discourse-cdn.com/v4/letter/t/c6cbf5/32.png) [@t\_mne2021](https://mne.discourse.group/u/t_mne2021)\
**Post date:** [January 6, 2021, 2:09am UTC](https://mne.discourse.group/t/mne-io-read-raw-edf/2428/5 "2021-01-06T02:09:54Z")

</div>

Thanks again for your answers. I read your paper and am very interested for your work. Can you share the code in your paper or the code for processing the MASS data set? I made some mistakes in processing the data of some subjects  
Thanks you very much  
Best  
Tian.

Alexandre Gramfort via MNE Forum \<[mne@discoursemail.com](mailto:mne@discoursemail.com)\> 于2021年1月6日周三 上午4:25写道：

---

<div class="post-metadata">

**Author:** ![agramfort](https://avatars.discourse-cdn.com/v4/letter/a/7c8e57/32.png) [@agramfort](https://mne.discourse.group/u/agramfort)\
**Post date:** [January 6, 2021, 7:30am UTC](https://mne.discourse.group/t/mne-io-read-raw-edf/2428/6 "2021-01-06T07:30:54Z")

</div>

I don’t have the reading code in a usable form. The best I can offer is to share:

> **[Sleep staging on the Sleep Physionet dataset — Braindecode 0.5 documentation](https://braindecode.org/auto_examples/plot_sleep_staging.html?highlight=chambon)**

---

<div class="post-metadata">

**Author:** ![t\_mne2021](https://avatars.discourse-cdn.com/v4/letter/t/c6cbf5/32.png) [@t\_mne2021](https://mne.discourse.group/u/t_mne2021)\
**Post date:** [January 6, 2021, 8:21am UTC](https://mne.discourse.group/t/mne-io-read-raw-edf/2428/7 "2021-01-06T08:21:53Z")

</div>

Thanks for your sharing  
Best

Alexandre Gramfort via MNE Forum \<[mne@discoursemail.com](mailto:mne@discoursemail.com)\> 于2021年1月6日周三 下午3:41写道：
