Dear MNE-Python Community,
I am currently working with an EpochsTFR
object and encountering challenges when attempting to select specific epochs using a boolean mask. Below are the details of my setup and the issue:
- MNE Version: 1.9.0
- Operating System: Ubuntu 20.04
Code Snippet:
import numpy as np
import mne
# Assuming 'power_epochs' is an existing EpochsTFR object
valid_idx = [
False, True, False, True, False, True, False, True,
False, False, True, False, False, True, True, False,
True, True, False, True, True, False, True, True,
True, True, True, True, True, False
]
# Attempting to select epochs using the boolean mask
matching_epochs = power_epochs[valid_idx]
Issue:
When executing the above code, I encounter the following error:
IndexError: list assignment index out of range
Observations:
- The length of
valid_idx
matches the number of epochs inpower_epochs
. - Using integer indices instead of a boolean mask does not resolve the issue.
- Accessing
power_epochs.selection[valid_idx]
returns the expected array of selected indices.
Request:
I am seeking guidance on the correct method to index or select specific epochs from an EpochsTFR
object using a boolean mask or an alternative approach. Any insights or suggestions to resolve this issue would be greatly appreciated.
Thank you for your assistance.
Best regards,
Hironobu Nakamura