psychopy.org | Reference | Downloads | Github

Use the data without exiting the experiment procedure

Hey guys:

I will try my best to make my problems easy to understand.

My goal is to make my two-step experiment successfully work. It seems easy to achieve. But I actually need to use the data recorded in the first section of the experiment so that some of the manipulation settings in the second part of experiment can work well.

Note:

  1. My experiment is totally not complex. It is just a simple keyboard-response task.
  2. The data recorded in the first part of exp is stored in the csv files.
  3. What I want is to get the data transformed into the value of some variables in the second part of exp.

The problem is that, AFTER the first part of experiment ENDS, when I use ‘pandas.read_csv’ to read the file that has been written in the goal path, it appears that the file cannot be found. I am absolutely sure that the filename and the path is completely correct. I wonder why I can’t use the data in the middle of exp.

The question above can be easily solved if I seperate the exp into two parts. But is there any solution that can make it work in one-shot experiment?

Really really appreciate your reply and help.

What I do is save the data from the first part to lists (though a list of dictionaries would also work) which I can access directly. It’s certainly inefficient to save to disk and reread that same data within the same experiment. You can also probably access the list of dictionaries that PsychoPy generates to save the data but I find it easier to work with lists I’ve created

1 Like

Yeah, I actually use this method to get over it… So thankful for your reply!