psychopy.org | Reference | Downloads | Github

Random selection from two separate blocks (.xlsx files)

Hi,
I am new to psychopy and was successful with a simple demo experiment. Now I have to develop something more advanced and have come across an issue. I hope I am not cross-posting but I couldn’t find anything that could solve this. I thank anyone who would have some advise! (For more information, I am attaching a screenshot of builder and the code of my experiment.)

OS (e.g. MacOs High Sierra 10.13.6):
PsychoPy version (e.g. 3.1.5):

What are you trying to achieve?:*
I have 8 words as sound stimuli in 2 conditions (Set1 and Set2). This means 8 times the same word but with an acoustic variation (8x2=16). The aim is that each participant is presented to all 8 words but to a random condition (=8 words, 4 are from Set1 and 4 from Set2). This should be also random for a larger set of participants.

What did you try to make it work?:
I have followed all steps found in Randomly selecting a subset of 5 excel rows from groups of 10 rows on each trial.

Hence, I have:
two inner loops (trial_1 and trial_2)
one outer loop (outer_loop)
two .xlsx files (teststimuli.xlsx and teststimuli2.xlsx)
a bit of code for randomisation.

What specifically went wrong when you tried that?:
The experiment breaks down and the stimuli are not random
When I run the experiment:
Introduction is ok
Set1 is presented 4 times
Set2 is presented 4 times
It breaks down and then I get this error message:

" ######## Running: /Users/catalinat/Desktop/Ex_Aix/JeuDeMots_lastrun.py #########
2019-09-11 10:52:12.374 python[2350:38386] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to (null)
Traceback (most recent call last):
File “/Users/catalinat/Desktop/Ex_Aix/JeuDeMots_lastrun.py”, line 448, in
trialList=data.importConditions(control_blocks.pop(), selection=choice(8, size=4, replace=False)),
IndexError: pop from empty list

######## Running: /Users/catalinat/Desktop/Ex_Aix/JeuDeMots_lastrun.py #########
2019-09-11 11:00:10.636 python[2396:40529] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to (null)
Traceback (most recent call last):
File “/Users/catalinat/Desktop/Ex_Aix/JeuDeMots_lastrun.py”, line 448, in
trialList=data.importConditions(control_blocks.pop(), selection=choice(8, size=4, replace=False)),
IndexError: pop from empty list

"JeuDeMots.psyexp (34.7 KB)

1 Like

Hi Catalint,
I’m not able to work out why your experiment isn’t working (been a long time since I was working in PsychoPy- and I’m still quite a beginner myself). However due to the amazing support I have received in the past I am keen to help if I can. I’m happy to share files with you if that might help? Anyway welcome to the community.
Kirsten.

1 Like

Hello Kerstin,
I just saw in Sequence of 4 random events followed by a rating event as a block which will be looped through for all stimuli that there was a similar issue but no one ever got back to him :frowning:

I have to run the experiment on another computer and tried it on a windows machine. But there is the same issue. Do you still have psychopy 1.9.3? Could you run my code with some dummy sound stimuli? I can upload the .xlsx files. teststimuli.xlsx (8.7 KB) teststimuli2.xlsx (8.7 KB)