diff --git a/fitgrid/epochs.py b/fitgrid/epochs.py
index 1b09227..b14ad8a 100644
--- a/fitgrid/epochs.py
+++ b/fitgrid/epochs.py
@@ -41,12 +41,13 @@ class Epochs:
         levels_to_remove = set(epochs_table.index.names)
         levels_to_remove.discard(EPOCH_ID)
 
-        # so we remove all levels from index except EPOCH_ID
-        epochs_table.reset_index(list(levels_to_remove), inplace=True)
-        assert epochs_table.index.names == [EPOCH_ID]
+        # copy since we are about to modify
+        self.table = epochs_table.copy()
+        # remove all levels from index except EPOCH_ID
+        self.table.reset_index(list(levels_to_remove), inplace=True)
+        assert self.table.index.names == [EPOCH_ID]
 
-        self.table = epochs_table
-        snapshots = epochs_table.groupby(TIME)
+        snapshots = self.table.groupby(TIME)
 
         # check that snapshots across epochs have equal index by transitivity
         prev_group = None
@@ -66,10 +67,13 @@ class Epochs:
         if not prev_group.index.is_unique:
             raise FitGridError(
                 f'Duplicate values in {EPOCH_ID} index not allowed:',
-                tools.get_index_duplicates_table(epochs_table, EPOCH_ID),
+                tools.get_index_duplicates_table(self.table, EPOCH_ID),
             )
 
-        # we're good, set instance variable
+        self.table.reset_index(inplace=True)
+        self.table.set_index([EPOCH_ID, TIME], inplace=True)
+        assert self.table.index.names == [EPOCH_ID, TIME]
+
         self.snapshots = snapshots
 
     def lm(self, LHS='default', RHS=None):

Set epochs table index to EPOCH_ID and TIME during Epochs creation
In `__init__` we reset the index to only keep `EPOCH_ID`. After `snapshots` are created, set index to `EPOCH_ID`, `TIME`. This is needed for plotting of individual epochs.
diff --git a/tests/test_epochs.py b/tests/test_epochs.py
index 736db4b..a92bf85 100644
--- a/tests/test_epochs.py
+++ b/tests/test_epochs.py
@@ -2,7 +2,8 @@ import pytest
 import numpy as np
 
 from .context import fitgrid
-from fitgrid import fake_data, epochs, errors
+from fitgrid import fake_data, errors
+from fitgrid.epochs import Epochs
 
 
 def test_epochs_unequal_snapshots():
@@ -13,7 +14,7 @@ def test_epochs_unequal_snapshots():
 
     epochs_table.drop(epochs_table.index[42], inplace=True)
     with pytest.raises(errors.FitGridError) as error:
-        epochs.Epochs(epochs_table)
+        Epochs(epochs_table)
     assert 'differs from previous snapshot' in str(error.value)
 
 
@@ -34,6 +35,23 @@ def test__raises_error_on_epoch_index_mismatch():
 
     # now time index is equal to row number in the table overall
     with pytest.raises(errors.FitGridError) as error:
-        epochs.Epochs(epochs_table)
+        Epochs(epochs_table)
 
     assert 'differs from previous snapshot' in str(error.value)
+
+
+def test_multiple_indices_end_up_EPOCH_ID_and_TIME():
+
+    from fitgrid import EPOCH_ID, TIME
+
+    epochs_table = fake_data._generate(
+        n_epochs=10, n_samples=100, n_categories=2, n_channels=32
+    )
+    epochs_table.reset_index(inplace=True)
+    epochs_table.set_index([EPOCH_ID, TIME, 'categorical'], inplace=True)
+
+    epochs = Epochs(epochs_table)
+    # internal table has EPOCH_ID and TIME in index
+    assert epochs.table.index.names == [EPOCH_ID, TIME]
+    # input table is not altered
+    assert epochs_table.index.names == [EPOCH_ID, TIME, 'categorical']

pip install -e .
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y gcc
3.9
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
blosc2==2.5.1
contourpy==1.3.0
cycler==0.12.1
exceptiongroup==1.2.2
-e git+https://github.com/kutaslab/fitgrid.git@1cba86280c45b7a5f1422621167aeee1952a2254#egg=fitgrid
fonttools==4.56.0
importlib_resources==6.5.2
iniconfig==2.1.0
kiwisolver==1.4.7
matplotlib==3.9.4
msgpack==1.1.0
ndindex==1.9.2
numexpr==2.10.2
numpy==2.0.2
packaging==24.2
pandas==2.2.3
patsy==1.0.1
pillow==11.1.0
pluggy==1.5.0
py-cpuinfo==9.0.0
pyparsing==3.2.3
pytest==8.3.5
python-dateutil==2.9.0.post0
pytz==2025.2
scipy==1.13.1
six==1.17.0
statsmodels==0.14.4
tables==3.9.2
tomli==2.2.1
tqdm==4.67.1
tzdata==2025.2
zipp==3.21.0

name: fitgrid
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
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - 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=3.0.16=h5eee18b_0
  - pip=25.0=py39h06a4308_0
  - python=3.9.21=he870216_1
  - readline=8.2=h5eee18b_0
  - setuptools=75.8.0=py39h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.45.1=py39h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - blosc2==2.5.1
      - contourpy==1.3.0
      - cycler==0.12.1
      - exceptiongroup==1.2.2
      - fonttools==4.56.0
      - importlib-resources==6.5.2
      - iniconfig==2.1.0
      - kiwisolver==1.4.7
      - matplotlib==3.9.4
      - msgpack==1.1.0
      - ndindex==1.9.2
      - numexpr==2.10.2
      - numpy==2.0.2
      - packaging==24.2
      - pandas==2.2.3
      - patsy==1.0.1
      - pillow==11.1.0
      - pluggy==1.5.0
      - py-cpuinfo==9.0.0
      - pyparsing==3.2.3
      - pytest==8.3.5
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - scipy==1.13.1
      - six==1.17.0
      - statsmodels==0.14.4
      - tables==3.9.2
      - tomli==2.2.1
      - tqdm==4.67.1
      - tzdata==2025.2
      - zipp==3.21.0
prefix: /opt/conda/envs/fitgrid

tests/test_epochs.py::test_multiple_indices_end_up_EPOCH_ID_and_TIME
tests/test_epochs.py::test__raises_error_on_epoch_index_mismatch
tests/test_epochs.py::test_epochs_unequal_snapshots
fitgrid/epochs.py
fitgrid/epochs.py