# Randomization a subset of stimuli within builder

**URL:** <https://discourse.psychopy.org/t/randomization-a-subset-of-stimuli-within-builder/35725>\
**Category:** Builder\
**Tags:** randomization\
**Created:** [July 16, 2023, 8:47pm UTC](https://discourse.psychopy.org/t/randomization-a-subset-of-stimuli-within-builder/35725 "2023-07-16T20:47:49Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![JensBoelte](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.psychopy.org/jensboelte/32/9060_2.png) [@JensBoelte](https://discourse.psychopy.org/u/JensBoelte)\
**Post date:** [July 19, 2023, 8:02am UTC](https://discourse.psychopy.org/t/randomization-a-subset-of-stimuli-within-builder/35725/4 "2023-07-19T08:02:45Z")

</div>

Hello Ben

> How should I transfer the stimuli (1/f-noise-stimuli) into an Excel-conditions file?

Just give the filename of the corresponding stimulus. See your point 3. And yes, if you are using an Excel file as a conditions file, you will have to type them in, or you could use Excel to generate them for you (create the numbers 1:n by dragging the lower left corner of a selection of two cells, one containing 1, the other containing 2, then use the concatenate function to add the folder name and extension).

> [@PsychoBen](#):
>
> How to randomly assign the foils (60 stimuli) to the beforehand chosen 4 targets?

Ok, you need independent randomisation. You might want to take a look at

> [@Simplest code to select random rows of two alternating excel files (avoiding delays along the experiment)](https://discourse.psychopy.org/t/simplest-code-to-select-random-rows-of-two-alternating-excel-files-avoiding-delays-along-the-experiment/21693/18):
>
> You might be interested in my new demo Independent Randomisation [code](https://gitlab.pavlovia.org/vespr/independent-randomisation) | [try it](https://run.pavlovia.org/vespr/independent-randomisation/) Pre-load one column from a spreadsheet so that the contents can be displayed in an independent random order alongside the contents of another column. This demo also uses shuffle to randomise the location of the target.

If you are not planning to run the experiment online, you can import any Python library you need. Otherwise, do not use Python libraries. PsychoPs is automatically compiled into PsychoJS for online experiments. There may be no JavaScript equivalent for the imported Python library.

Best wishes Jens

---

_[View the full topic](https://discourse.psychopy.org/t/randomization-a-subset-of-stimuli-within-builder/35725)._
