{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from collections import OrderedDict\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "from bokeh.charts import Dot, output_notebook, show"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "output_notebook()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "# create some example data\n",
    "xyvalues = OrderedDict(\n",
    "    python=[2, 3, 7, 5, 26],\n",
    "    pypy=[12, 33, 47, 15, 126],\n",
    "    jython=[22, 43, 10, 25, 26],\n",
    ")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "dots = Dot(\n",
    "    xyvalues, cat=['lists','loops','dicts', 'gen exp', 'exceptions'],\n",
    "    title=\"Dots Example, dict input\", ylabel='Performance', legend='top_left')\n",
    "show(dots)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "df = pd.DataFrame(xyvalues)\n",
    "dots = Dot(\n",
    "    df, cat=['lists','loops','dicts', 'gen exp', 'exceptions'],\n",
    "    title=\"Dots Example, pandas input\", ylabel='Performance', legend='top_left')\n",
    "show(dots)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "lxyvalues = list(xyvalues.values())\n",
    "dots = Dot(\n",
    "    lxyvalues, cat=['lists','loops','dicts', 'gen exp', 'exceptions'],\n",
    "    title=\"Dots Example, list input\", ylabel='Performance', legend='top_left')\n",
    "show(dots)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": [
    "from blaze import Data\n",
    "\n",
    "bxyvalues = Data(df)\n",
    "dots = Dot(bxyvalues, cat=['lists','loops','dicts', 'gen exp', 'exceptions'],\n",
    "         title=\"Dots Example\", ylabel='Performance', notebook=True)\n",
    "show(dots)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {
    "collapsed": false
   },
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.9"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 0
}
