ica.find_bads_muscle --> AttributeError: 'ICA' object has no attribute 'find_bads_muscle'

:question: If you have a question or issue with MNE-Python, please include the following info:

  • MNE version: e.g. 0.24.0
  • operating system: Windows 10

:page_facing_up: Please also provide relevant code snippets – ideally a minimal working example (MWE).

:fountain_pen: To get the correct formatting, paste your Python code, then select it, and click on the Preformatted text toolbar button.

#Setting up ICA
    
    ica = mne.preprocessing.ICA(n_components=20, random_state=97, max_iter=800)
    ica.fit(raw, picks = 'eeg')
    
    #ica.exclude = [1, 2]  # details on how we picked these are omitted here
    #ica.plot_properties()
    raw.drop_channels('M1')
    raw.drop_channels('M2')
    
    # Removing muscle artefacts
    muscle_idx_auto, scores = ica.find_bads_muscle(raw)
    ica.plot_scores(scores, exclude=muscle_idx_auto)
    ica.exclude = muscle_idx_auto
![bad muscle|690x240](upload://gxIwi0b7OFIbr8i1eRbf4AIp1he.png)

The running above code is producing an attribute error.
AttributeError: ‘ICA’ object has no attribute ‘find_bads_muscle’

This was added in MNE 1.1.

1 Like