In [ ]:
from collections import OrderedDict
import pandas as pd
import numpy as np
from bokeh._legacy_charts import Dot, output_notebook, show
In [ ]:
output_notebook()
In [ ]:
# create some example data
xyvalues = OrderedDict(
python=[2, 3, 7, 5, 26],
pypy=[12, 33, 47, 15, 126],
jython=[22, 43, 10, 25, 26],
)
In [ ]:
dots = Dot(
xyvalues, cat=['lists','loops','dicts', 'gen exp', 'exceptions'],
title="Dots Example, dict input", ylabel='Performance', legend='top_left')
show(dots)
In [ ]:
df = pd.DataFrame(xyvalues)
dots = Dot(
df, cat=['lists','loops','dicts', 'gen exp', 'exceptions'],
title="Dots Example, pandas input", ylabel='Performance', legend='top_left')
show(dots)
In [ ]:
lxyvalues = list(xyvalues.values())
dots = Dot(
lxyvalues, cat=['lists','loops','dicts', 'gen exp', 'exceptions'],
title="Dots Example, list input", ylabel='Performance', legend='top_left')
show(dots)
In [ ]:
from blaze import Data
bxyvalues = Data(df)
dots = Dot(bxyvalues, cat=['lists','loops','dicts', 'gen exp', 'exceptions'],
title="Dots Example", ylabel='Performance', notebook=True)
show(dots)
In [ ]: