psychopy.org | Reference | Downloads | Github

Error from pandas when saving file


#1

I get a surprise error message when trying to save the results.
It says:
File “/Users/direc/anaconda/lib/python2.7/site-packages/pandas/indexes/base.py”, line 2271, in get_indexer
raise InvalidIndexError(‘Reindexing only valid with uniquely’

InvalidIndexError: Reindexing only valid with uniquely valued Index objects

It is apparently caused by the following line in my script:

trials.saveAsWideText(fileName, delim=’;’, appendFile=False, encoding=‘utf-8’)

I am getting this all of the sudden after many experiments with a very similar structure and partly identical code, but unfortunately have no idea what aspect of my changes caused this behavior. I am getting it on at least two systems (Mac, Win) and probably also on a third (Linux) where I discovered that data files are created but empty.

Any suggestions are very welcome.


#2

Seems I found the cause by myself. It seems that pandas is trying to say that two variables have the same name. It occurred when I tried to add a variable that was already included by the trial handler.