| Reference | Downloads | Github

Presenting text at variable times according to spreadsheet


I am designing a memory experiment where a series of short video clips are shown, in which an image is shown at variable points in the video. Images are shown at either 3, 4.5, 6, or 7.5 seconds (edited in iMovie). I am attempting to get a question to appear on the screen in PsychoPy one second before the image pops up (so either 2, 3.5, 5, or 6.5 seconds from the start time of the video).

I have made an Excel spreadsheet to be used in the loop to randomize the order in which the videos are played. In this spreadsheet, I have a column with the name of the video file, the time of the image presentation, as well as the time at which I would like the question to appear. My goal is to program the task so that the column with the question presentation time will be called according to the video that has been selected to play. I have only worked with Python at a very basic level, but have been doing some digging online and believe that the answer may lie in the library “pandas” to call cells of the spreadsheet according to the name of the row).

I appreciate any insight anyone would be able to provide for me, and am happy to clarify details about what I am trying to do. Thanks!

Hi @Kate_Checknita

I do not think you need pandas for this specific task. All of these things will be done nicely by the trial handler. So, all you need is to set your loop and condition file. Then, in each trial, one row will be picked and all of your variables pick the value of that row. Suppose you have a file like this:

Screen Shot 2020-02-27 at 3.27.54 pm

Then, in the first loop, say the second row will be picked (randomly). Your video component would play 2.wav, your image component will show your image after 4.5 seconds and your text will be shown in 3.4 seconds.