psychopy.org | Reference | Downloads | Github

Referring to information from data output

I’m programming an experiment in which participants loop through several scenarios presented in random order and press buttons. Which buttons were pressed in which scenario and trial is saved in a csv file. Then, I want to refer back to the button presses stored in the csv file and show participants some more stimuli contingent on their prior button presses.

However, the csv file seems to be written only after the program has fully run through. When I refer to the log file in the interim, it is still empty. Is there a smart way to get around this problem that someone could point out to me? I would be forever grateful!

Thanks!

Hi @Ria12

You could add a code component, and add the following to the relevant tabs

##### Begin Experiment #####
import pandas as pd

##### End Routine #####
dat = pd.DataFrame.from_dict(thisExp.getAllEntries())

Then you can access data as you would from a Pandas dataframe from your new dat variable

1 Like