This might be more of a Pyodide question
This might be more of a Pyodide question, but I am trying to load a CSV file using Pandas
read_csv
in a WASM notebook. I've got the file on Github and loading it via the raw URL. In the WASM notebook I'm getting a URLError: <urlopen error unknown url type: https>
and if I change to to an http url I get a URLError: <urlopen error [Errno 26] Operation in progress>
. anyone know the issue here?16 Replies
Can you share your notebook? if you are able to. or send a minimal repro
Here is the repo: https://github.com/mcburton/you-vs-mmlu
GitHub
GitHub - mcburton/you-vs-mmlu: How do YOU fair against the MMLU ben...
How do YOU fair against the MMLU benchmark? Contribute to mcburton/you-vs-mmlu development by creating an account on GitHub.
warning, it is a HACK job 😉
WASM link : https://marimo.app/l/tvm5ru
marimo | a next-generation Python notebook
Explore data and build apps seamlessly with marimo, a next-generation Python notebook.
you can do:
that worked!
would that code work when not running in pyodide? or do I need some logic for the notebook to decide which approach to load the data?
yea would need some logic - you can check if you are in pyodide or not by trying to
import pyodide
and catching the error
we can add this to our docs, or maybe patch it pd.read_csv
if its not too hackyIs this a Marimo issue or a more general pyodide issue with Pandas...
pyodide
. they have particular ways to request data. and whatever pandas is using isnt compatible. but pyodide
may add more compat to fetching libraries in future
e.g. maybe this is what we need https://github.com/koenvo/pyodide-http
it supports url
and requests
yeah, might be good to note this in the docs. I would think fetching data from the web would be a common pattern for WASM notebooks.
most definitely
sweet, well I got my little POC running for my noon meeting. Thanks!
https://marimo.app/l/m93ysb?mode=read
marimo | a next-generation Python notebook
Explore data and build apps seamlessly with marimo, a next-generation Python notebook.
@mcburton , very glad to see you trying out WASM notebooks! Thanks for being patient with these kinds of issues. Offer still stands -- I'd love to chat with you over a video call sometime. You have my email 🙂
Yes! It's on my todo list. I've got spring break next week so I can catch up on things. I'll be in touch soon
Just wanted to add on, I also had this issue and struggled to figure it out 🙂
Thanks for letting us know — sorry about that! We will improve our documentation and work on finding a fix