Hi I am trying to make an experiment such that the duration of one part of the survey (a fixation cross) varies based on a preset distribution, which is list_name= [4,6,2,2,2,4,2,2,4,2,6,10]. I want the duration to sample without replacement (using np.random.choice(list_name, replace=False), but I want the sampling without replacement to reset every 12 trials. So on the 13th trial it will restart with the full list and continue to sample without replacement.
I tried inserting this code into the begin routine part of a code component
if trials.thisN in [0:11]:
list_name=[4,6,2,2,2,4,2,2,4,2,6,10]
x_duration=np.random.choice(list_name,replace=False)
However, I keep receiving an error in the code. Does anyone have any suggestions?