logo

... ipywidgets: display



Notes

You can also make components that query text. Just make sure you use display when you're interested in showing dataframes.

import pandas as pd
import ipywidgets as widgets

df = pd.read_json("https://calmcode.io/datasets/pokemon.jsonl", 
                  lines=True, 
                  orient="record")

def reduce(q):
    subset = df.loc[lambda d: d['name'].str.contains(q)]
    display(subset)

q = widgets.Text()

out = widgets.interactive_output(reduce, {'q': q})

widgets.VBox([q, out])

Feedback? See an issue? Something unclear? Feel free to mention it here.



If you want to be kept up to date, consider signing up for the newsletter.