With open('newConditionsList' + str(j) + '. In the code I correct the missing “s” and change de ‘w’ for ‘w’.Ĭonditions = for k in randomIndices] # select just 5 of them The newConditionsList1 isn’t created ! I don’t know why. This (hopefully) generates two new csv files (newConditionsList1.csv and newConditionsList2.csv), which you can then use for your two loops. With open('newConditionList' + j + '.csv',‘w’) as file: # create a new CSV file I set the loop type in random and left in blank the random seed option but that only set a different random order for every subject not for every repeat of the loop. I want to set the loop so every repeat, the stimuli list appears in a different random order. NewConditions = # define an initially empty listĬonditions = conditions] # select just 5 of them OS: Win10 PsychoPy version : 2021.2.1 I’m building a Simple Reaction Time experiment. # generate two files with non-overlapping subsets, 40 trials each RowsLoop2 = list(set(range(10)) - set(RowsLoop1)) Not sure if it works, since I don’t have the files to test it. So, do I understand you correctly that participants only go through the first and the second loop once with both having 40 trials? So you basically want to take your 8 csv files, sample 5 rows out of each one for the first loop, and then sample the 5 others for the second loop? # Experiment ended with exit code 1 #Īh sorry, I thought the categories would be presented one after the other because you were talking about 8 different csv files and you have one outer loop. TrialList=data.importConditions(‘newConditionList1.csv’, selection=RowsLoop1),įile “/Applications/PsychoPy 2.app/Contents/Resources/lib/python3.8/psychopy/data/utils.py”, line 463, in importConditions I tried to change L "range(80), 40) and range(80)įile “/Users/Catherine/Desktop/SC-AAT_build/test_lastrun.py”, line 380, in Add a variable called condition, change the number of cycles to 2. Output = csv.DictWriter(file, fieldnames=header) # arrange to write our dictionaries to it With open(‘newConditionList1.csv’,‘w’) as file: # create a new CSV file So instead to randomizing newlist, randomize cuelist. You have not yet randomized filler and stimuli. Header = newConditions.keys() # get the header labels as a list There is no need to set the loop type to random. However, when looking at the output file, I can see that the order of Type/ voice trials is the same on every repeat. This works so the same voice files do not repeat twice in a row. # will end up as 20 randomly selected but balanced-for-consistency trials Loop one (trials) repeats 6 times and the outer loop (trials3) repeats 4 times (So overall totalling 24 trials in one block). Shuffle(conditions) # randomise their orderĬonditions = conditions # select just ten of them NewConditions = # define an initially empty listįor fileName in :Ĭonditions = data.importConditions(fileName) # create a list of dictionaries Here, I have 8 categories, separated in 8 csv files. But with this code, we can see only 5 words instead of 40 like before…
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |