I am using streamlit version v0.68 and currently working on CSV file for data analysis.
st.title('Report Analysis')
uploaded_file = st.file_uploader("Choose a file")
if uploaded_file is not None:
data = pd.read_csv(uploaded_file, low_memory=False)
st.write(data.shape)
First it works, but if I rerun the program in my localhost it gives me the error:
EmptyDataError: No columns to parse from file
Traceback:
File "D:\My Programs\Projects\ReportAnalysis\venv\lib\site-packages\streamlit\script_runner.py", line 324, in _run_script
exec(code, module.__dict__)
File "D:\My Programs\Projects\ReportAnalysis\epl\app.py", line 9, in <module>
data = pd.read_csv(uploaded_file, low_memory=False)
File "D:\My Programs\Projects\ReportAnalysis\venv\lib\site-packages\pandas\io\parsers.py", line 686, in read_csv
return _read(filepath_or_buffer, kwds)
File "D:\My Programs\Projects\ReportAnalysis\venv\lib\site-packages\pandas\io\parsers.py", line 452, in _read
parser = TextFileReader(fp_or_buf, **kwds)
File "D:\My Programs\Projects\ReportAnalysis\venv\lib\site-packages\pandas\io\parsers.py", line 946, in __init__
self._make_engine(self.engine)
File "D:\My Programs\Projects\ReportAnalysis\venv\lib\site-packages\pandas\io\parsers.py", line 1178, in _make_engine
self._engine = CParserWrapper(self.f, **self.options)
File "D:\My Programs\Projects\ReportAnalysis\venv\lib\site-packages\pandas\io\parsers.py", line 2008, in __init__
self._reader = parsers.TextReader(src, **kwds)
File "pandas\_libs\parsers.pyx", line 540, in pandas._libs.parsers.TextReader.__cinit__
How to handle this error?
data = pd.read_csv(uploaded_file, low_memory=False)
this is line 9. I had only written the code and not the imports here. – Uponst.write(data.head())
when you rerun the script – Trilogy