Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

one column csv import error #152

Open
Tracked by #151
krajcsi opened this issue Dec 28, 2020 · 1 comment
Open
Tracked by #151

one column csv import error #152

krajcsi opened this issue Dec 28, 2020 · 1 comment
Labels

Comments

@krajcsi
Copy link
Contributor

krajcsi commented Dec 28, 2020

When the csv or clipboard data include only a single column, separator is not found correctly (which is actually missing in those cases). This comes from the pd.read_csv() function where parameter sep=None. Alternative solution also should automatically detect the format of the csv files.

@krajcsi krajcsi added the bug label Dec 28, 2020
@krajcsi
Copy link
Contributor Author

krajcsi commented Dec 5, 2023

see the issue in pandas-dev/pandas#53035

consider using https://github.com/alan-turing-institute/CleverCSV instead (although at the moment, clevercsv cannot handle io.StringIO() )

Unfortunately, with a test file, clevercsv cannot read single column csv file:

  File "/home/attila/Programs/CogStat_venv_py310/lib/python3.10/site-packages/clevercsv/wrappers.py", line 337, in read_dataframe
    csv_dialect = dialect.to_csv_dialect()
  File "/home/attila/Programs/CogStat_venv_py310/lib/python3.10/site-packages/clevercsv/dialect.py", line 118, in to_csv_dialect
    return dialect()
  File "/usr/lib/python3.10/csv.py", line 45, in __init__
    self._validate()
  File "/usr/lib/python3.10/csv.py", line 52, in _validate
    raise Error(str(e))
_csv.Error: "delimiter" must be a 1-character string

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant