0
votes

I am trying to loop through four separate time windows to utilize time as a feature for EEG data analysis but cannot figure out how to loop through the 4 time bins. I have included pictures of where the time bins are establish and the loop 1&2

I have also tried reorganizing the for loop like this: for t in range(0,nTrainBin): trainData = np.full((len(chanList),nEv,config.nF,nTrainBin),np.nan)

        if trainBin[t][0] == trainBin[t][1]:
            trainData = zpower[:,:,:,trainBin[t][0]]
        else:
            if using_one_band == 1:
                trainData[c,:,t] = zpower[c,:,trainBin[t]], axis=2
            else:
                trainData[c,:,:,t] = zpower[c,:,:,trainBin[t]], axis=3

but am getting the error: "cannot unpack non-iterable int object" and am not sure why

1
Hello and welcome! Please take the site's tour and go over the help center to get familiar with it. Especially take your time to read about How to Ask and how to provide a minimal reproducible example. Most importantly, if you want people to be reluctant to help you, don't post links to images. You can simply copy-paste the code as text and reformat it. Use the formatting page to help you - Tomerikoo

1 Answers

0
votes

Looks like you are trying to loop through each of the lists in your trainBin list? It is a 2d array so you can access the first value [0,500] using bin1 = trainBin[0]. Then you can use the same logic to access the rest.