psychopy.org | Reference | Downloads | Github

Issue with Store History in Rating Scale

I’m getting an error when I try to save the csv (summaries) file or the excel file and also have the ‘Store History’ setting on with a rating scale:

“~/adhder_build2_noanticipation_lastrun.py”, line 521, in
dataOut=[‘n’,‘all_mean’,‘all_std’, ‘all_raw’])
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/data.py”, line 524, in saveAsText
matrixOnly=matrixOnly)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/psychopy/data.py”, line 1123, in _createOutputArray
tup = eval(strVersion) # convert back to a tuple
File “”, line 1
[(, 0.0)]
^
SyntaxError: invalid syntax

The error does not occur if I either don’t try to save the summary csv or don’t try to store the rating history. Does anyone have insight into this?

Thanks much!

Don’t use the summary .csv file format. The code behind it isn’t able to take means, SDs, etc of variables which contain something other than a single value per trial.

You want the trial-by-trial csv format, in which you do any summarising yourself later.

Thanks. I was also able to resolve it by adding

if rating.history[-1][0] is None:
    rating.history = [('-1',0.0)]
else:
    rating.history = rating.history[1:]

in the # -------Ending Routine “response”------- block above the trials.addData lines

1 Like