Check, uncheckbox error

Dear awesome-streamlit users!

I’m using file_uploader to upload a csv file, I converted the bytesIO file to a dataframe and created a checkbox to show the first 5 lines in my dataframe.
No issues no upload file or when I check the checkbox for the first time, otherwise when I uncheck the box and re-check the box I got the following error:

EmptyDataError: No columns to parse from file

Traceback:

```
File "/anaconda3/lib/python3.7/site-packages/streamlit/script_runner.py", line 324, in _run_script
    exec(code, module.__dict__)File "/Users/danielmille/Documents/FCA2_deploy.py", line 50, in <module>
    df = bytes_to_df(uploaded_file)File "/Users/danielmille/Documents/FCA2_deploy.py", line 19, in bytes_to_df
    df = pd.read_csv('data.txt', index_col = [0])File "/anaconda3/lib/python3.7/site-packages/pandas/io/parsers.py", line 702, in parser_f
    return _read(filepath_or_buffer, kwds)File "/anaconda3/lib/python3.7/site-packages/pandas/io/parsers.py", line 429, in _read
    parser = TextFileReader(filepath_or_buffer, **kwds)File "/anaconda3/lib/python3.7/site-packages/pandas/io/parsers.py", line 895, in __init__
    self._make_engine(self.engine)File "/anaconda3/lib/python3.7/site-packages/pandas/io/parsers.py", line 1122, in _make_engine
    self._engine = CParserWrapper(self.f, **self.options)File "/anaconda3/lib/python3.7/site-packages/pandas/io/parsers.py", line 1853, in __init__
    self._reader = parsers.TextReader(src, **kwds)File "pandas/_libs/parsers.pyx", line 545, in pandas._libs.parsers.TextReader.__cinit__
```

Does anybody know how to solve it?

In addition, once I upload the csv file is it possible to run more than 1 function with it?

1 Like

Hi danimille, I have the same issue, do you find any solution?

Not yet!

1 Like

I am having the same problem and just posted the same question.

1 Like