[Mne_analysis] problem with combine_evoked() function

nick menger nickmenger at hotmail.com
Thu Feb 20 07:50:20 EST 2020
Search archives:

        External Email - Use Caution        

Dear all,

The combine_evoked() function seems to be not working in my code (using MNE 20.0 (dev) on Windows 10, Python 3.7.5). I tried reading in some saved evoked files for multiple participants with the following code:


# Read in evoked EEG for all participants
list_evokeds = list()                   # list to append evokeds to
for subject in subject_list:            # looping through my directory with computed evokeds (subject_list corresponds to list of strings with subject codes)
    fname = pathlib.Path(f"my_path{subject}-ave.fif")   # setting filename for each saved evoked file (where 'my_path' corresponds to a real path in my code obviously)
    evoked = mne.read_evokeds(fname)    # reading the evoked file
    list_evokeds.append(evoked)         # append it to a list
combined_evoked = mne.combine_evoked(list_evokeds, weights='nave')   # Results in AttributeError: 'list' object has no attribute 'nave'


The problem being the AttributeError that the list has no 'nave' attribute (same problem arises when setting 'weights' parameter to 'equal'. The problem traces back to the first line of the function's code:

line 869, in combine_evoked

naves = np.array([evk.nave for evk in all_evoked], float)

Could anyone tell me whether computing the attribute this way is necessary, or how I should modify my input to the function, so it works? If further info is needed, please let me know!

Thanks!


Verzonden vanuit Outlook<http://aka.ms/weboutlook>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.nmr.mgh.harvard.edu/pipermail/mne_analysis/attachments/20200220/fcb70a6f/attachment.html 


More information about the Mne_analysis mailing list