#!/usr/bin/env python3 # -*- coding: utf-8 -*- """ Created on Wed Jul 29 10:03:16 2020 @author: lau """ import numpy as np import mne from os.path import join ## CREATING EPOCHS OBJECT data_path = join(mne.datasets.sample.data_path(), 'MEG', 'sample', 'sample_audvis_raw.fif') info = mne.io.read_info(data_path) n_epochs = 1000 n_channels = len(info['ch_names']) n_samples = 1500 data = np.random.rand(n_epochs, n_channels, n_samples) epochs = mne.EpochsArray(data, info) epochs.save('split_file-epo.fif') ## STEPPING OUT OF PYTHON ## renaming "split_file-epo.fif "copy_split_file-epo.fif" ## results in error because the next split file is still called ## "split_file-epo.fif" in the FIFF structure copied_epochs = mne.read_epochs('copy_split_file-epo.fif')