Hi guys!
I’m trying to read a csv via pd.read_csv, uploaded via your uploader -
It doesn’t seem to work - Am I using the correct file?
Thanks!
Charly
Hi guys!
I’m trying to read a csv via pd.read_csv, uploaded via your uploader -
It doesn’t seem to work - Am I using the correct file?
Thanks!
Charly
Hi @Charly_Wargnier, thanks for the question!
You can use q.site.download
to bring the file from the Wave server to your machine, and then read into pandas. In this example, file_upload
is the name
of my ui.file_upload
q.client.working_file_path = await q.site.download(
url=q.args.file_upload[0],
path='./my_local_data_location'
)
df = pd.read_csv(q.client.working_file_path)
Here’s an example app which allows for uploading a dataset and then displaying a table, to show you how it all works together:
Thanks @mtanco! I’ll try.
Btw, is this expected to get an issue on the former script (I’m using Windows 10)?
Here’s the error I get:
Error
Traceback (most recent call last):
File "c:\users\charly\desktop\wave-apps\venv\lib\site-packages\h2o_wave\server.py", line 265, in _process
await self._handle(q)
File ".\upload_Best.py", line 16, in serve
await handle_uploaded_data(q)
File ".\upload_Best.py", line 82, in handle_uploaded_data
make_ui_plot_card(q)
NameError: name 'make_ui_plot_card' is not defined
Thanks,
Charly
oops, good catch! I forgot to comment out a different function I was testing it’s been updated
Thanks Michelle for the prompt response!
Apologies, I should have checked and comment it out myself
Out of interest:
Thanks,
Charly