Skip to content

Instantly share code, notes, and snippets.

@euri10
Last active October 9, 2015 14:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save euri10/43e95faefd57889465d5 to your computer and use it in GitHub Desktop.
Save euri10/43e95faefd57889465d5 to your computer and use it in GitHub Desktop.
basic bokeh Bar chart
Display the source blob
Display the rendered blob
Raw
import pandas as pd
from bokeh.charts import Bar
from bokeh.plotting import show
from bokeh.io import output_notebook
output_notebook()
campaign = pd.DataFrame({'Delivery date': ['9/11/2013', '9/11/2013', '9/18/2013', '10/2/2013', '10/8/2013', '10/15/2013', '10/17/2013',
'10/22/2013', '11/8/2013'],
'Google Tracking Code': ['msag1413e ', 'mss1113e ', 'mss1813e ', 'mso213e ', 'mso813e2 ', 'mso1413e ', 'mssigns13 ',
'sepp102213 ', 'msn813e1 '],
'Visits': [2777, 3361, 3140, 3111, 2306, 2097, 3135, 1925, 1839],
'Revenue': ['3776', '9606.5', '19269.28', '47121.6', '13271.43', '28417.8', '1285.47', '694.36', '4572'],
'Transactions': ['43', '40', '68', '157', '47', '89', '12', '8', '16']
}, index=['msag1413e ', 'mss1113e ', 'mss1813e ', 'mso213e ', 'mso813e2 ', 'mso1413e ', 'mssigns13 ',
'sepp102213 ', 'msn813e1 '])
bar_columns=campaign[["Visits"]]
print bar_columns
bar = Bar(bar_columns)
show(bar)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment