packages = ["matplotlib", "pandas", "seaborn"] # A simple serverless static interactive python notebook The notebook you see here executes Python code directly in the browser thanks to Pyscript. Tailwind.css and marked.js are used to render the text written in Markdown directly into the HTML. This page is entirely static and created without compilation. To learn more, you can read the article here: https://medium.com/@nicogalland/a-simple-serverless-static-interactive-python-notebook-with-pyscrypt-marked-js-and-tailwind-css-ef40419345d1 ## Interactive Python code in the browser Success score in French middle schools against parents's socio-professional level, by county.
Processing...
import pandas as pd, numpy as np, seaborn as sns, matplotlib.pyplot as plt from js import document; from pyscript import when; from pyodide.http import open_url df = pd.read_csv(open_url("final.csv")) @when("change", "#dep") def chart(): dep = document.querySelector("#dep").value g = sns.jointplot(x='ips', y='taux_mention_bien+', data=df, kind="hex"); sns.scatterplot(x='ips', y='taux_mention_bien+', data=df.query('departement == @dep'), s=18, ax=g.ax_joint, color='red') display(plt.gcf(), target="graph-area", append=False) chart()