# Error trying filter and plot data using EMG data

**URL:** <https://mne.discourse.group/t/error-trying-filter-and-plot-data-using-emg-data/2922>\
**Category:** Support & Discussions\
**Tags:** visualization, frequency-filter, emg\
**Created:** [April 6, 2021, 1:22am UTC](https://mne.discourse.group/t/error-trying-filter-and-plot-data-using-emg-data/2922 "2021-04-06T01:22:28Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rodrigohubner](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/rodrigohubner/32/353_2.png) [@rodrigohubner](https://mne.discourse.group/u/rodrigohubner)\
**Post date:** [April 6, 2021, 1:22am UTC](https://mne.discourse.group/t/error-trying-filter-and-plot-data-using-emg-data/2922/1 "2021-04-06T01:22:28Z")

</div>

- mne==0.20.8
- operating system: Linux Mint (using Jupyter notebook)

I need a help about an error just i run `epoch.filter(l_freq=20., h_freq=450.)`  
**Error** : `ValueError: picks (NoneNone, treated as "data_or_ica") yielded no channels, consider passing picks explicitly`

That error happen when I use `epoch.plot_psd` too…  
I am working with sEMG data… Anyone known what is it?

A complete error is follow:

```python
obj_filtered = epoch.filter(l_freq=20., h_freq=450.)
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-29-b3662d60ef07> in <module>
----> 1 obj_filtered = epoch.filter(l_freq=20., h_freq=450.)

<decorator-gen-111> in filter(self, l_freq, h_freq, picks, filter_length, l_trans_bandwidth, h_trans_bandwidth, n_jobs, method, iir_params, phase, fir_window, fir_design, skip_by_annotation, pad, verbose)

~/repo/lib/python3.8/site-packages/mne/filter.py in filter(self, l_freq, h_freq, picks, filter_length, l_trans_bandwidth, h_trans_bandwidth, n_jobs, method, iir_params, phase, fir_window, fir_design, skip_by_annotation, pad, verbose)
   1923 if pad is None and method != 'iir':
   1924 pad = 'edge'
-> 1925 update_info, picks = _filt_check_picks(self.info, picks,
   1926 l_freq, h_freq)
   1927 if isinstance(self, BaseRaw):

~/repo/lib/python3.8/site-packages/mne/filter.py in _filt_check_picks(info, picks, h_freq, l_freq)
   2232 update_info = False
   2233 # This will pick *all* data channels
-> 2234 picks = _picks_to_idx(info, picks, 'data_or_ica', exclude=())
   2235 if h_freq is not None or l_freq is not None:
   2236 data_picks = _picks_to_idx(info, None, 'data_or_ica', exclude=(),

~/repo/lib/python3.8/site-packages/mne/io/pick.py in _picks_to_idx(info, picks, none, exclude, allow_empty, with_ref_meg, return_kind)
    982 raise ValueError('picks must be 1D, got %sD' % (picks.ndim,))
    983 if picks.dtype.char in ('S', 'U'):
--> 984 picks = _picks_str_to_idx(info, picks, exclude, with_ref_meg,
    985 return_kind, extra_repr, allow_empty,
    986 orig_picks)

~/repo/lib/python3.8/site-packages/mne/io/pick.py in _picks_str_to_idx(info, picks, exclude, with_ref_meg, return_kind, extra_repr, allow_empty, orig_picks)
   1038 if len(picks_generic) == 0 and orig_picks is None and \
   1039 not allow_empty:
-> 1040 raise ValueError('picks (%s) yielded no channels, consider '
   1041 'passing picks explicitly'
   1042 % (repr(orig_picks) + extra_repr,))

ValueError: picks (NoneNone, treated as "data_or_ica") yielded no channels, consider passing picks explicitly

```

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [April 6, 2021, 10:07am UTC](https://mne.discourse.group/t/error-trying-filter-and-plot-data-using-emg-data/2922/2 "2021-04-06T10:07:58Z")

</div>

> [@rodrigohubner](#):
>
> - mne==0.20.8

Hello, would it be possible for you to update to the latest stable version of MNE and see if the problem still occurs there?

Thanks!

Richard

---

<div class="post-metadata">

**Author:** ![rodrigohubner](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/rodrigohubner/32/353_2.png) [@rodrigohubner](https://mne.discourse.group/u/rodrigohubner)\
**Post date:** [April 6, 2021, 7:16pm UTC](https://mne.discourse.group/t/error-trying-filter-and-plot-data-using-emg-data/2922/3 "2021-04-06T19:16:40Z")

</div>

Hello!

I updated to latest version (mne-0.22.1) and the problem continues…  
I noticed that set the object info with `eeg` in `ch_types` parameter, the problem is solved. But I don’t know if `eeg` would change something about the signal internally …

it works =\> `info = mne.create_info(ch_names=('1', '2'), sfreq=4000, ch_types='eeg')`

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [April 6, 2021, 8:05pm UTC](https://mne.discourse.group/t/error-trying-filter-and-plot-data-using-emg-data/2922/4 "2021-04-06T20:05:41Z")

</div>

The underlying problem here is that filtering by default only works with [“data channels”](https://mne.tools/stable/glossary.html#term-data-channels), i.e. channels that typically contain brain activity. EMG is no data channel.

I think what **should** work is passing `picks='emg'` to `filter()` in order to enforce operation on the `emg` channel type. Can you give it a shot? 🙂

---

<div class="post-metadata">

**Author:** ![rodrigohubner](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/rodrigohubner/32/353_2.png) [@rodrigohubner](https://mne.discourse.group/u/rodrigohubner)\
**Post date:** [April 7, 2021, 1:30am UTC](https://mne.discourse.group/t/error-trying-filter-and-plot-data-using-emg-data/2922/5 "2021-04-07T01:30:34Z")

</div>

> [@richard](#):
>
> I think what **should** work is passing `picks='emg'` to `filter()` in order to enforce operation on the `emg` channel type.

Yes, it works now!  
In last version, passing the argument `picks='emg'` showed another error… Something like “data channel not found”.  
Thank you!

---

<div class="post-metadata">

**Author:** ![richard](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/richard/32/15_2.png) [@richard](https://mne.discourse.group/u/richard)\
**Post date:** [April 7, 2021, 8:10am UTC](https://mne.discourse.group/t/error-trying-filter-and-plot-data-using-emg-data/2922/6 "2021-04-07T08:10:27Z")

</div>

> [@rodrigohubner](#):
>
> In last version, passing the argument `picks='emg'` showed another error… Something like “data channel not found”.

Yep, that’s a bug report I found on GitHub and figured it had been fixed in the meantime. Therefore I was asking you to update MNE 🙂 Great to hear it’s working for you now!! Have a good day!

---

<div class="post-metadata">

**Author:** ![Mousatat](https://yyz2.discourse-cdn.com/free1/user_avatar/mne.discourse.group/mousatat/32/2367_2.png) [@Mousatat](https://mne.discourse.group/u/Mousatat)\
**Post date:** [March 20, 2023, 2:07am UTC](https://mne.discourse.group/t/error-trying-filter-and-plot-data-using-emg-data/2922/8 "2023-03-20T02:07:41Z")

</div>

yep it worked for me to, thanks
