psychopy.org | Reference | Downloads | Github

Randomizing two lists in one loop

I am new to psychopy, and easily confused. I feel that this is a straightforward problem that is oddly difficult for me to achieve, so any help would be greatly appreciated.

PsychoPy version1.90.1
What are you trying to achieve?: Create random pairs (the pairings must be random) of 2 lists, appearing simultaneously on the screen.

What did you try to make it work?: Googled and googled, and I am confused. So far, I’ve got one condition file with two columns: Column 1 contains images (filepaths). Column 2 contains words (text).The words are meant to appear on the same screen as the image, with random pairs of columns 1 and 2 generated each time without repetition.
example of my conditions file (condFile.xlsx):
imagePath--------Word
a.jpg----------------eye
b.jpg----------------are
c.jpg----------------confused
…etc
I do not want image c.jpg to appear with “confused” every time.
I created an image stim and text stim in the same routine, referring to $imagePath and $word. I then put a loop around it referring to condFile.xlsx and set it to random.

What specifically went wrong when you tried that?: Rows are locked, and the pairs generated from column 1 and 2 are the same each time.

I feel like I’m missing something big here. Thanks in advance.

Hello, you aren’t missing something. This (independently shuffling columns in a conditions file) isn’t a feature that Builder currently offers but is probably the most-requested upgrade we need to implement for linking conditions files to loops.

So for the time being, you’ll need to do this yourself, using code to do the column shuffling for you at the start of each experimental session. e.g. see this post:

Give it a go and come back to us with any problems.