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 NewConditions = # define an initially empty listĬonditions = conditions] # select just 5 of them # generate two files with non-overlapping subsets, 40 trials each Your routines are necessarily presented in a fixed order, as shown in the time line. RowsLoop2 = list(set(range(10)) - set(RowsLoop1)) These only need to be presented once (so 25 trials). There are 5 faces displaying 5 different emotional expressions making 25 unique stimuli in total. Not sure if it works, since I don’t have the files to test it. If your input file has many rows what is the better loop type Random. 1 In my experiment, I am presenting images (faces) that are different across 2 dimensions: face identity and emotion. 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 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 PsychoPybuilder view What you need is to open the PsychoPybuilder view and follow our step-by step tutorial on how to build an experiment. Header = newConditions.keys() # get the header labels as a list Begin Routine: m圜ount m圜ount + 1 if m圜ount > 10: trials.finished True Note In Python there is no end to finish an if statement. # will end up as 20 randomly selected but balanced-for-consistency trials 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. |