I usually add a bit of code to my Builder experiments after each block of trials to save participants’ data into a single .csv file containing data for all participants, e.g.
Block_loop.saveAsWideText(“AnimalStroop_allParticipants.csv”, delim=’,’, matrixOnly=True, appendFile=True)
This is currently not working in one of my experiments and I can’t figure out why: It works fine in another very similar experiment. Any help would be much appreciated. The error message is:
Block_loop.saveAsWideText("AnimalStroop_allParticipants.csv", delim=',', matrixOnly=True, appendFile=True)
File “/Users/lpzjwp/code/psychopy/git/psychopy/data/trial.py”, line 696, in saveAsWideText
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pandas/core/frame.py”, line 4319, in append
other.index).difference(self.columns).tolist()
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pandas/indexes/base.py”, line 1737, in union
indexer = self.get_indexer(other)
File “/Applications/PsychoPy2.app/Contents/Resources/lib/python2.7/pandas/indexes/base.py”, line 2082, in get_indexer
raise InvalidIndexError(‘Reindexing only valid with uniquely’
pandas.indexes.base.InvalidIndexError: Reindexing only valid with uniquely valued Index objects
I’ve attached the code for the two experiments. I’m running psychopy 1.85.4 on Mac OS 10.12.6
Animal stroop_saveAsWideTextWORKS.py (26.7 KB)
saveAsWideText_DOESNTWORK.py (26.0 KB)