All picks must be < n_channels (20), got 20 means that you provided the value 20 to select channels in a recording which only includes 20 channels. As indexing is 0-indexed, the maximum value is 19 (note the strictly inferior to n_channels (20) in the error message).
I can not tell you which indexing or which line in your code is the culprit based on the information in your question. If you share a code snippet, please share a valid and complete code snippet.
What is EEG? A list? An array? Of what shape?
What is the correct indentation?
What is the complete error traceback (message)?
Also, you should probably consider updating your version of MNE, the 0.24.0 is 1.5 years old and many bugfixes and new features have been added.
What is EEG signals? Numpy arrays I expect? And of what shape?
I think you are providing an info with a given number of channels and an array with a different number of channels, thus an error is raised due to the mismatch.
Please donβt post screenshots, they are difficult to work with. You can provide code directly in the message and format it with Ctrl+E or the associated button in the edition bar.
Those code snippets donβt make a lot of sense to me, each element in your list EEG seems to be a Raw object returned by read_raw_edf. RawArray is used to create a Raw object from a numpy array of shape (n_channels, n_times) and an Info, while in your case you are providing EEG[i] which seems to be already a Raw object.
@Mel please open a separate question thread for your question β this particular error can arise from many different causes and the best way to solve it is for you to provide a reproducible code sample of your own (the fix that worked for @isabelceo might not work for your case)