When attempting to load eeg, we sometimes run into IndexError: too many indices for array. I believe this happens if any of the epochs being loaded fall outside the bounds of the eeg file.
For example:
reader = CMLReader("R1310J", "FR1", 1)
pairs = reader.load("pairs")
events = reader.load("events")
words = events[events["type"] == "WORD"]
eeg = reader.load_eeg(events=words, rel_start=0, rel_stop=1000, scheme=pairs)
If you instead don't exclude some of the last events, it works:
eeg = reader.load_eeg(events=words.iloc[:-26], rel_start=0, rel_stop=1000, scheme=pairs)
This can happen if, for whatever reason, the recording stopped early or if it was a session with multiple eeg files and an event occurs close to the end of the recording.
When attempting to load eeg, we sometimes run into
IndexError: too many indices for array. I believe this happens if any of the epochs being loaded fall outside the bounds of the eeg file.For example:
If you instead don't exclude some of the last events, it works:
This can happen if, for whatever reason, the recording stopped early or if it was a session with multiple eeg files and an event occurs close to the end of the recording.