Skip to content

Instantly share code, notes, and snippets.

@JessicaWachtel
Created December 30, 2025 18:16
Show Gist options
  • Select an option

  • Save JessicaWachtel/45e9e91523fa3f01f323d2d0fd594fec to your computer and use it in GitHub Desktop.

Select an option

Save JessicaWachtel/45e9e91523fa3f01f323d2d0fd594fec to your computer and use it in GitHub Desktop.
pyodide.runPython(`
import pandas as pd
from io import StringIO
from js import document
# Load CSV
df = pd.read_csv(StringIO(csv_text))
# Show first rows
document.getElementById("data-output").innerText = df.head().to_string()
# Populate column dropdown
select = document.getElementById("column-select")
select.innerHTML = ""
option_default = document.createElement("option")
option_default.value = ""
option_default.text = "--Select--"
select.appendChild(option_default)
for col in df.columns:
option = document.createElement("option")
option.value = col
option.text = col
select.appendChild(option)
# Show summary statistics
summary_text = df.describe().to_string()
document.getElementById("summary-output").innerText = summary_text
`);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment