Randomizing without repetition in loops

Hello everyone,
I’m completely new to PsychoPy without any coding experience, and I would really appreciate any sort of help.

What are you trying to achieve?: : I have 90 pictures and 3 different conditions.

What did you try to make it work?: : I want each condition to appear in a pseudo-randomized order i.e., not more than twice in a row and without repetition.

What specifically went wrong when you tried that?:. : I managed to make it in a randomized order. But i’ve still problem with repetition.

How can i prevent this?
Any help will be greatly appreciated.
Thank you!

image

image

code : import random, xlrd
from numpy.random import choice

trial_loop = loopType : random
nReps: 30
conditions : loop_repetititon.xlsx → nReps1, nReps2, nReps3

Hello,

this question has been asked before. Look here

or here

or here

Best wishes Jens

Although I am late in responding, I thank the recommendations.

We added additional conditions besides the picture in three separate trials, which is how I came up with the following answer and avoided repetition: I created a list and prepared each condition as an excel file. I then used the pop.() function to stop the repetition.