# epochs should throw an error if labels doesn't exist

**URL:** <https://mne.discourse.group/t/epochs-should-throw-an-error-if-labels-doesnt-exist/1482>\
**Category:** Mailing List Archive (read-only)\
**Tags:** list-archive\
**Created:** [April 10, 2018, 8:38pm UTC](https://mne.discourse.group/t/epochs-should-throw-an-error-if-labels-doesnt-exist/1482 "2018-04-10T20:38:20Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 10, 2018, 8:38pm UTC](https://mne.discourse.group/t/epochs-should-throw-an-error-if-labels-doesnt-exist/1482/1 "2018-04-10T20:38:20Z")

</div>

Let's say you have an epochs object which you believe has labels 'foo' and  
'bar', but really 'bar' doesn't exist as a label in the object.

epochs['bar'].average() throws an error, which seems reasonable

epochs[['foo', 'bar']].average() does not throw an error and might be  
responsible for creating a whole field of brain science based on false  
results 😉

This is 0.13.1

-Dan  
-------------- next part --------------  
An HTML attachment was scrubbed...  
URL: [http://mail.nmr.mgh.harvard.edu/pipermail/mne\_analysis/attachments/20180410/1031bcb0/attachment.html](http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20180410/1031bcb0/attachment.html)

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/free1/uploads/mne/original/1X/85cc6bd2b69cb698a166dc6d880fb550510d0144.jpeg) [@system](https://mne.discourse.group/u/system)\
**Post date:** [April 11, 2018, 12:22pm UTC](https://mne.discourse.group/t/epochs-should-throw-an-error-if-labels-doesnt-exist/1482/2 "2018-04-11T12:22:12Z")

</div>

hi,

I create the issue

[https://github.com/mne-tools/mne-python/issues/5117](https://github.com/mne-tools/mne-python/issues/5117)

thanks for the bug report.

Alex
