In [ ]:
from collections import OrderedDict

import numpy as np

from bokeh.charts import Bar
from bokeh.sampledata.olympics2014 import data as original_data

data = {d['abbr']: d['medals'] for d in original_data['data'] if d['medals']['total'] > 0}

countries = sorted(data.keys(), key=lambda x: data[x]['total'], reverse=True)

gold = np.array([data[abbr]['gold'] for abbr in countries], dtype=np.float)
silver = np.array([data[abbr]['silver'] for abbr in countries], dtype=np.float)
bronze = np.array([data[abbr]['bronze'] for abbr in countries], dtype=np.float)

medals = OrderedDict(bronze=bronze, silver=silver, gold=gold)

bar = Bar(medals, countries, title="grouped, dict_input", xlabel="countries", ylabel="medals", 
          legend=True, width=800, height=600, notebook=True)
bar.show()

In [ ]:
bar = Bar(medals, countries, title="grouped, dict_input", xlabel="countries", ylabel="medals", 
          legend=True, width=800, height=600, notebook=True, stacked=True)
bar.show()

In [ ]:
import pandas as pd
df = pd.DataFrame(medals, index=countries)

bar = Bar(df, title="grouped, df_input", xlabel="countries", ylabel="medals", legend=True, width=800, height=600, notebook=True, stacked=True)
bar.show()

In [ ]:
bar=bar = Bar(df, title="grouped, df_input", xlabel="countries", ylabel="medals", legend=True, width=800, height=600, notebook=True, stacked=False)
bar.show()

In [ ]:
from bokeh.plotting import output_notebook, show
medals = np.array([bronze, silver, gold])
bar = Bar(df, title="grouped, df_input", xlabel="countries", ylabel="medals", legend=True, width=800, height=600)
output_notebook()
show(bar)

In [ ]: