Hello. I’m trying to convert a csv to dataframe using FileInput. Can I somehow read the csv directly into the dataframe, or do I need first reading the csv with BytesIO?
The below attempt failed with error message “EmptyDataError: No columns to parse from file”. The FileInput widget did not appear, which seems to be part of the problem.
import io
import panel as pn
file_input = pn.widgets.FileInput(accept='.csv, .xls')
file_input
if file_input.value is not None:
out = io.BytesIO()
file_input.save(out)
df = pd.read_csv(out)