MNE-Python is an open-source Python package for exploring, visualizing, and analyzing human neurophysiological data such as MEG, EEG, sEEG, ECoG, NIRS, and more. It provides modules for data input/output, preprocessing, visualization, source estimation, time-frequency analysis, connectivity analysis, machine learning, and statistics. The library is actively developed, with stable releases occurring frequently, typically every few months.
pip install --upgrade mneVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates loading a sample MEG/EEG dataset, applying a basic filter to the continuous data, defining events, creating epoched data, computing an evoked response, and finally plotting the evoked activity.
Upgrade your Python environment to 3.10 or newer.
Ensure `scikit-learn` is installed: `pip install scikit-learn`.
For final analysis, it is generally recommended to resample `Epochs` objects using `mne.Epochs.resample()` after epoching, or to be aware of the implications if resampling `Raw` data early.
Initialize mutable defaults inside the function, e.g., `def func(arg=None): arg = arg if arg is not None else []`.
Carefully review channel quality, use `raw.plot(block=True)` for interactive marking, and utilize MNE-Python's tools for marking and interpolating bad channels (e.g., `raw.info['bads']`, `raw.interpolate_bads()`). Consider `autoreject` for automated detection.
Use `subjects` instead of `subject` when calling `mne.datasets.eegbci.load_data()`.