[Mne_analysis] Indexing the nth epoch of a condition

Lyam Bailey Lyam.Bailey at dal.ca
Tue Jun 20 13:23:49 EDT 2017
Search archives:

Dear MNE users,

I'm analysing an EEG dataset which contains event markers for four separate conditions. The data has been segmented into epochs defined by these event markers. Stimuli from each condition appeared ten times during the experiment - therefore my dataset contains 40 epochs, ten per condition.

I'm generating evokeds for each condition with the following code:

subjects = {'001','002','003','005','006','007','008','009','010'}
conditions = {'cond_1','cond_2','cond_3','cond_4'}
cond = {}

for subject  in subjects:
    epochs_fname[subject]  = data_path + subject + '-epo.fif'
    epochs[subject] = mne.read_epochs(epochs_fname[subject])
    evoked[subject] = {cond:(epochs[subject][cond]).average() for cond in  (conditions)}

However I would like to base my evokeds on only the first instance of each condition (i.e. the first time participants saw a stimulus from cond_1, the first time they saw a stimulus from cond_2, and so on). To this end, is there a way to index the nth epoch from each condition that would fit in the above code?

Any help would be greatly appreciated!




Lyam Bailey, BSc.

Graduate Student
Department of Psychology & Neuroscience
Dalhousie University

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20170620/80ddc9c0/attachment.html 

More information about the Mne_analysis mailing list