I am adapting an experiment that I previously wrote in matlab (using PTB) to the PsychoPy framework, using the Builder (which is a pleasure to use, thanks for your time & effort!), with the aim of running it online.
I want each participant to have a unique sequence of trials. The way I do this is with a code component at the beginning of the experiment. In the component, all the trial conditions are assigned and defined in a ‘dict’ called ‘seq’. I then save these variables to a csv file, using pandas.
pd_seq = pd.DataFrame.from_dict(seq)
pd.DataFrame.to_csv(pd_seq, ‘seq.csv’)
This csv file is used to control the conditions for each trial.
When I export the project to pavlovia, I doesn’t work. I believe the issue is the code component in python has:
import pandas as pd
which is translated into JS as:
import * as pd from ‘pandas’;
Does anyone have any suggestions? [it is possible I am going about this completely the wrong way - I am relatively new to this, apologies if this is obvious]
If you need further details please let me know and I will add the code.
Thanks