I created three seemingly identically structured tab-delimited files (attached) for purposes of counterbalancing. Whereas gr_C_B.csv works fine, the other two raise “pandas.errors.ParserError: Error tokenizing data. C error: Expected 2 fields in line 3, saw 3” (see log below). I have checked the files several times and can’t find an error. R or TAD have no problem reading them. What could be the reason?
Puzzled, Jochen
2020-04-29 00:43:40.051 python[69117:58521129] ApplePersistenceIgnoreState: Existing state will not be touched. New state will be written to (null)
Traceback (most recent call last):
File "/long/path/deleted/AB_grC_lastrun.py", line 363, in <module>
trialList=data.importConditions("gr_C_"+expInfo['group']+".csv"),
File "/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/data/utils.py", line 305, in importConditions
sep=sep, dec=dec)
File "/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/psychopy/data/utils.py", line 219, in _attemptImport
sep=sep, decimal=dec)
File "/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/pandas/io/parsers.py", line 709, in parser_f
return _read(filepath_or_buffer, kwds)
File "/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/pandas/io/parsers.py", line 455, in _read
data = parser.read(nrows)
File "/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/pandas/io/parsers.py", line 1069, in read
ret = self._engine.read(nrows)
File "/Applications/PsychoPy3.app/Contents/Resources/lib/python3.6/pandas/io/parsers.py", line 1839, in read
data = self._reader.read(nrows)
File "pandas/_libs/parsers.pyx", line 902, in pandas._libs.parsers.TextReader.read
File "pandas/_libs/parsers.pyx", line 924, in pandas._libs.parsers.TextReader._read_low_memory
File "pandas/_libs/parsers.pyx", line 978, in pandas._libs.parsers.TextReader._read_rows
File "pandas/_libs/parsers.pyx", line 965, in pandas._libs.parsers.TextReader._tokenize_rows
File "pandas/_libs/parsers.pyx", line 2208, in pandas._libs.parsers.raise_parser_error
pandas.errors.ParserError: Error tokenizing data. C error: Expected 2 fields in line 3, saw 3
gr_C_A.csv (670 Bytes) gr_C_B.csv (671 Bytes) gr_C_C.csv (670 Bytes)