Published
Edited
Jan 3, 2022
Insert cell
Insert cell
kgzip.filenames.filter((a) => a.indexOf("kglab-main/dat") !== -1)
Insert cell
Insert cell
Insert cell
Insert cell
df = py`
from os.path import dirname
import os
import io

buffer = io.StringIO(${await kgzip.file("kglab-main/dat/recipes.csv").text()})
df = ${pd}.read_csv(buffer)
df
`
Insert cell
table(df.to_dict("records").toJs().map(Object.fromEntries))
Insert cell
Insert cell
recipe_row = py`
df = ${df}
recipe_row = df[df["name"] == "anytime crepes"].iloc[0]
recipe_row`
Insert cell
Insert cell
Insert cell
Insert cell
py`ingredients = eval(${recipe_row}["ingredients"])
ingredients`
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
Insert cell
pd = py`
import pandas as pd#${packagesPy}
pd`
Insert cell
kglab = py`

# make completely sure pyvis got included
import micropip
micropip.install("https://thadk.net/pyodide_packages/pyodide_18_1/pyvis-0.1.9-py2.py3-none-any.whl")

import kglab
# ${otherKglabDependencies} ${kglabDependency} ${micropipDependenciesPy}
kglab
`
Insert cell
py`dir(${kglab})`
Insert cell
py`repr(${kglab})`
Insert cell
Insert cell
import { py, pyodide, downloadPyoFile } from "@thadk/pyodide-18"
Insert cell

Purpose-built for displays of data

Observable is your go-to platform for exploring data and creating expressive data visualizations. Use reactive JavaScript notebooks for prototyping and a collaborative canvas for visual data exploration and dashboard creation.
Learn more