Problem
When I tried to import a measurements .csv I got a ParserError: Error tokenizing data. C error: Expected 20 fields in line 3, saw 23 from ~\mambaforge\envs\devbio-napari-env\lib\site-packages\pandas\_libs\parsers.pyx:
Cause
pandas is unable to read .csv files that use semicolon as seperator. When importing the file with pd.read_csv() the exact same error occurs, and will succesfully import when given the additional parameter sep = ";" or sep = None (auto detect). Note that semicolon seperated .csv files usually use comma as decimal seperator, which requires decimal="," (no auto detect available), otherwise decimal numbers will be interpreted as strings.
→ So its not a problem of devbio-napari, but pandas and the different .csv and number formats.
Workaround
After replacing the seperators to match pandas default (comma and dot) the import of the csv file into napari worked.
Also see
Problem
When I tried to import a measurements .csv I got a
ParserError: Error tokenizing data. C error: Expected 20 fields in line 3, saw 23from~\mambaforge\envs\devbio-napari-env\lib\site-packages\pandas\_libs\parsers.pyx:Cause
pandas is unable to read .csv files that use semicolon as seperator. When importing the file with
pd.read_csv()the exact same error occurs, and will succesfully import when given the additional parametersep = ";"orsep = None(auto detect). Note that semicolon seperated .csv files usually use comma as decimal seperator, which requiresdecimal=","(no auto detect available), otherwise decimal numbers will be interpreted as strings.→ So its not a problem of devbio-napari, but pandas and the different .csv and number formats.
Workaround
After replacing the seperators to match pandas default (comma and dot) the import of the csv file into napari worked.
Also see