# Random sampling from conditions file with no repetition ERROR

**URL:** <https://discourse.psychopy.org/t/random-sampling-from-conditions-file-with-no-repetition-error/4216>\
**Category:** Builder\
**Created:** [March 27, 2018, 2:04pm UTC](https://discourse.psychopy.org/t/random-sampling-from-conditions-file-with-no-repetition-error/4216 "2018-03-27T14:04:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![bee](https://avatars.discourse-cdn.com/v4/letter/b/ce7236/32.png) [@bee](https://discourse.psychopy.org/u/bee)\
**Post date:** [March 27, 2018, 2:04pm UTC](https://discourse.psychopy.org/t/random-sampling-from-conditions-file-with-no-repetition-error/4216/1 "2018-03-27T14:04:52Z")

</div>

Hello,

I am currently trying to randomise trials in a loop, without Psychopy selecting stimuli that it has selected previously. I have used information from a previous thread and inserted this into the code component:

![36](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/2/f/2f6ce93b340d8735bc315c2d78934c5c29752315.png)

I then inserted this into the inner loop

![16](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/6/0/60967f9f92cb7dce83d2d1e34481ce6c7cbe2c19.png)

The coding works to a certain degree, but crashes. I am a newbie and have a feeling i did not understand previous instructions and maybe got some numbers wrong but can’t put my finger on it.

here is the error:

 ![02](https://us1.discourse-cdn.com/flex002/uploads/psychopy/original/3X/0/1/010706c167e42def4cd3b22e62c5eb8b827c4b44.png)

Please help!

To understand better, my experiment involves displaying 3 images in an image loop and then one video in a video loop, these have seperate loops. after displaying 3 images and then 1 video, there is an outer loop repeating the process 9 times. i am trying to control the video loop so that 1 is shown randomly from a list of 9 videos, but i dont want any videos repeated.
