Randomly pulling from two sets of images in a single trial

Hi @KateYang, you can create the AMP using Builder. In the attached example, I created a version of the AMP (based on Payne et al., 2005) without images, but words to describe the stimuli (e.g., prime = pleasant1, target= target1). You can replace the words with pictures.

To randomise the prime and target pairings, I have added a few lines of code in a code component which shuffles the prime stimuli, and a new conditions file is created (called “newCond.xlsx”) which is fed to the loop handler:

import pandas as pd 

# Get condition file
dat = pd.read_excel("cond.xlsx", index=False)
# Shuffle Prime column
dat.loc[:, 'Prime'] = np.random.permutation(dat['Prime'].values)
# save shuffled dataframe to new spreadsheet ready for loop
dat.to_excel("newCond.xlsx", index=False)

Here are the files to demostrate the task:
cond.xlsx (8.0 KB) amp.psyexp (14.3 KB)

If you are unfamiliar with Builder, I recommend the Stroop tutorial to get you familiar with Builder concepts.