psychopy.org | Reference | Downloads | Github

Number of rows in conditions file

Is there a system variable (such as thisRepN etc) that returns how many rows there are in the current conditions (XLS) file? I know this can be obtained by doing some maths starting from nTotal, but I just wonder if there is a simple way to obtain the number of rows itself. Many thanks!

Hi - the conditions file is loaded into a list called trialList by the trial handler - so you can access the number of rows in the file for in a loop called trials like:

print(len(trials.trialList))

Best wishes,

Oli

Many thanks Oli!

Oli
June 28
Hi - the conditions file is loaded into a list called trialList by the trial handler - so you can access the number of rows in the file for in a loop called trials like:

> print(len(trials.trialList))