Average referencing eeg data

Hi,

With my eeg dataset, I marked a few channels as “bad channels” after loading it and then performed average referencing. I just wanted to check if average referencing accounts for the bad channels and excludes them when referencing.

raw=mne.io.read_raw_eeglab(filename) 

--- output----Channels marked as bad: ['F4', 'CP4', 'FC2']

raw = raw.set_eeg_reference("average")```

Bad channels are ignored when setting EEG reference. Quoting the EEG referencing tutorial:

Notice also that EEG 053 (which is marked as “bad” in raw.info['bads'] ) is not affected by the re-referencing.