win = int(4 * sf) # Window size is set to 4 seconds
freqs, psd = welch(data_NREM, sf, nperseg=win, average='median') # Works with single or multi-channel data
print(freqs.shape, psd.shape) # psd has shape (n_channels, n_frequencies)
in
2
3 win = int(4 * sf) # Window size is set to 4 seconds
----> 4 freqs, psd = welch(data_NREM, sf, nperseg=win, average='median') # Works with single or multi-channel data
5
6 print(freqs.shape, psd.shape) # psd has shape (n_channels, n_frequencies)
TypeError: welch() got an unexpected keyword argument 'average'
Please advice. Thank you for your help in the matter
Hello,
Running your example gives the following error
TypeError Traceback (most recent call last)