Running pandas in the browser
S. Roy
S. Roy
TEMPLATE. The playground runs real Python, pandas included, in the browser through Pyodide. No server executes anyone's code, which keeps it free to host and safe to share.
CPython compiled to WebAssembly, with the scientific stack prebuilt. import pandas works, and so does most code written for the desktop.
const py = await loadPyodide();
await py.loadPackage(["numpy", "pandas"]);
const result = py.runPython(source);The first load is the price: the runtime and packages are tens of megabytes before compression. They're cached after the first visit, and loading starts only when the playground is opened. (TEMPLATE: expand.)
Most of the wait is downloading and compiling the WebAssembly modules; the Python import itself is quick. Streaming compilation and a warm HTTP cache do most of the work. (TEMPLATE: expand.)