Define an _ipython_display_
function that takes no arguments to show a default display for the module.
%reload_ext deathbeds.__Custom_display_formatting
from deathbeds.__Custom_display_formatting import Row, Column
from pandas import *
from poser import *
import os
In this example we'll explore the Flowers datasets on Kaggle.
flowers = λ.Path('data/flowers/').Path.glob('*').map(λ.Path.glob('*')).concat().list().pandas.Series()()
flowers = flowers.apply(str).str.lstrip('data'+os.sep).str.split(os.sep, expand=True).set_index(flowers).rename(columns={
0:'label', 1: 'type', 2: 'file'})
from IPython.display import display
def _ipython_display_():
from ipywidgets import interact
@interact
def _(type=list(flowers.type.unique()), rows=3, columns=4):
display(Column([Row([str(x) for x in flowers[flowers.type.eq(type)].sample(columns).index])
for row in range(rows)]))
__import__(__name__)
interactive(children=(Dropdown(description='type', options=('daisy', 'dandelion', 'rose', 'sunflower', 'tulip'…