diff --git a/cmlreaders/readers/eeg.py b/cmlreaders/readers/eeg.py
index 709e3a5..4dbc94d 100644
--- a/cmlreaders/readers/eeg.py
+++ b/cmlreaders/readers/eeg.py
@@ -365,6 +365,10 @@ class EEGReader(BaseCMLReader):
             epochs = [(0, None)]
         epochs = DefaultTuple(epochs)
 
+        if not len(epochs):
+            raise ValueError("No events/epochs given! Hint: did filtering "
+                             "events result in at least one?")
+
         ts = []
 
         for fileno, epoch_lst in itertools.groupby(epochs, key=lambda x: x[-1]):

Poor error message when loading EEG and events are empty
Example: trying to filter events with a resulting DataFrame with no rows results in an `IndexError` when concatenating `TimeSeries` objects because none get added in the `as_timeseries` method. We should explicitly check for this case and raise a more helpful error message.
diff --git a/cmlreaders/test/test_eeg.py b/cmlreaders/test/test_eeg.py
index b4c347e..700669a 100644
--- a/cmlreaders/test/test_eeg.py
+++ b/cmlreaders/test/test_eeg.py
@@ -403,3 +403,12 @@ class TestRereference:
             reader = EEGReader("eeg")
             eeg = reader.load(scheme=scheme)
             assert_equal(eeg.data[0], self.reref_data)
+
+
+@pytest.mark.only
+class TestLoadEEG:
+    def test_load_with_empty_events(self):
+        reader = EEGReader("eeg")
+
+        with pytest.raises(ValueError):
+            reader.as_timeseries(epochs=[])

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest pytest-cov pytest-xdist pytest-mock pytest-asyncio
3.6
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
async-generator==1.10
attrs==22.2.0
Babel==2.11.0
bleach==4.1.0
cached-property==1.5.2
certifi==2021.5.30
charset-normalizer==2.0.12
-e git+https://github.com/pennmem/cmlreaders.git@dc66e6458b1b84ee6da9f5e9a2693a888450327c#egg=cmlreaders
codecov==2.1.13
coverage==6.2
decorator==5.1.1
defusedxml==0.7.1
docutils==0.18.1
entrypoints==0.4
execnet==1.9.0
flake8==3.9.2
h5py==3.1.0
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
iniconfig==1.1.1
ipython-genutils==0.2.0
Jinja2==3.0.3
jsonschema==3.2.0
jupyter-client==7.1.2
jupyter-core==4.9.2
jupyterlab-pygments==0.1.2
MarkupSafe==2.0.1
mccabe==0.6.1
mistune==0.8.4
mne==0.23.4
nbclient==0.5.9
nbconvert==6.0.7
nbformat==5.1.3
nbsphinx==0.8.8
nest-asyncio==1.6.0
numpy==1.19.5
packaging==21.3
pandas==1.1.5
pandocfilters==1.5.1
pluggy==1.0.0
py==1.11.0
pycodestyle==2.7.0
pyflakes==2.3.1
Pygments==2.14.0
pyparsing==3.1.4
pyrsistent==0.18.0
pytest==7.0.1
pytest-asyncio==0.16.0
pytest-cov==4.0.0
pytest-mock==3.6.1
pytest-xdist==3.0.2
python-dateutil==2.9.0.post0
pytz==2025.2
pyzmq==25.1.2
requests==2.27.1
scipy==1.5.4
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinx-rtd-theme==2.0.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jquery==4.1
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
testpath==0.6.0
tomli==1.2.3
tornado==6.1
traitlets==4.3.3
typing_extensions==4.1.1
urllib3==1.26.20
webencodings==0.5.1
zipp==3.6.0

name: cmlreaders
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - async-generator==1.10
      - attrs==22.2.0
      - babel==2.11.0
      - bleach==4.1.0
      - cached-property==1.5.2
      - charset-normalizer==2.0.12
      - codecov==2.1.13
      - coverage==6.2
      - decorator==5.1.1
      - defusedxml==0.7.1
      - docutils==0.18.1
      - entrypoints==0.4
      - execnet==1.9.0
      - flake8==3.9.2
      - h5py==3.1.0
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - iniconfig==1.1.1
      - ipython-genutils==0.2.0
      - jinja2==3.0.3
      - jsonschema==3.2.0
      - jupyter-client==7.1.2
      - jupyter-core==4.9.2
      - jupyterlab-pygments==0.1.2
      - markupsafe==2.0.1
      - mccabe==0.6.1
      - mistune==0.8.4
      - mne==0.23.4
      - nbclient==0.5.9
      - nbconvert==6.0.7
      - nbformat==5.1.3
      - nbsphinx==0.8.8
      - nest-asyncio==1.6.0
      - numpy==1.19.5
      - packaging==21.3
      - pandas==1.1.5
      - pandocfilters==1.5.1
      - pluggy==1.0.0
      - py==1.11.0
      - pycodestyle==2.7.0
      - pyflakes==2.3.1
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pyrsistent==0.18.0
      - pytest==7.0.1
      - pytest-asyncio==0.16.0
      - pytest-cov==4.0.0
      - pytest-mock==3.6.1
      - pytest-xdist==3.0.2
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - pyzmq==25.1.2
      - requests==2.27.1
      - scipy==1.5.4
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinx-rtd-theme==2.0.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jquery==4.1
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - testpath==0.6.0
      - tomli==1.2.3
      - tornado==6.1
      - traitlets==4.3.3
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - webencodings==0.5.1
      - zipp==3.6.0
prefix: /opt/conda/envs/cmlreaders

cmlreaders/test/test_eeg.py::TestLoadEEG::test_load_with_empty_events
cmlreaders/test/test_eeg.py::TestFileReaders::test_split_eeg_reader cmlreaders/test/test_eeg.py::TestFileReaders::test_split_eeg_reader_missing_contacts cmlreaders/test/test_eeg.py::TestFileReaders::test_ramulator_hdf5_reader_rhino[R1363T-FR1-0-178-True] cmlreaders/test/test_eeg.py::TestFileReaders::test_ramulator_hdf5_reader_rhino[R1392N-PAL1-0-112-False] cmlreaders/test/test_eeg.py::TestEEGReader::test_eeg_reader[R1298E-87-CH88] cmlreaders/test/test_eeg.py::TestEEGReader::test_eeg_reader[R1387E-13-CH14] cmlreaders/test/test_eeg.py::TestEEGReader::test_read_whole_session[R1161E] cmlreaders/test/test_eeg.py::TestEEGReader::test_eeg_reader_with_events[R1161E] cmlreaders/test/test_eeg.py::TestEEGReader::test_eeg_reader_with_events[R1387E] cmlreaders/test/test_eeg.py::TestEEGReader::test_rereference[R1384J-False-43-LS12-LS1] cmlreaders/test/test_eeg.py::TestEEGReader::test_rereference[R1111M-True-43-LPOG23-LPOG31] cmlreaders/test/test_eeg.py::TestEEGReader::test_filter_channels[R1384J-ind.region-insula-10-200] cmlreaders/test/test_eeg.py::TestEEGReader::test_filter_channels[R1288P-ind.region-lateralorbitofrontal-5-200] cmlreaders/test/test_eeg.py::TestEEGReader::test_filter_channels[R1111M-ind.region-middletemporal-18-100] cmlreaders/test/test_eeg.py::TestRereference::test_rereference[RamulatorHDF5Reader-True] cmlreaders/test/test_eeg.py::TestRereference::test_rereference[RamulatorHDF5Reader-False]
cmlreaders/test/test_eeg.py::TestBaseEEGReader::test_include_contact[True] cmlreaders/test/test_eeg.py::TestBaseEEGReader::test_include_contact[False] cmlreaders/test/test_eeg.py::TestFileReaders::test_npy_reader cmlreaders/test/test_eeg.py::TestFileReaders::test_ramulator_hdf5_reader cmlreaders/test/test_eeg.py::TestFileReaders::test_ramulator_hdf5_rereference cmlreaders/test/test_eeg.py::TestRereference::test_rereference[SplitEEGReader-True]
cmlreaders/readers/eeg.py
cmlreaders/readers/eeg.py