2015-2016/5e/Gestion_de_donnees/Tableau_graphique/Création de graphiques.ipynb

594 lines
91 KiB
Plaintext
Raw Normal View History

2017-06-16 06:48:54 +00:00
{
"cells": [
{
"cell_type": "code",
"execution_count": 14,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import pandas as pd\n",
"from opytex import texenv\n",
"%matplotlib inline\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"plt.style.use(\"seaborn-notebook\")"
]
},
{
"cell_type": "code",
"execution_count": 15,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import pymath as pm"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Création de graphiques pour les 5e"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Visite de villages"
]
},
{
"cell_type": "code",
"execution_count": 89,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[48, 15, 36, 43, 25]"
]
},
"execution_count": 89,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ds = pm.Dataset.random(5, distrib=\"randint\", rd_args=(10, 50))\n",
"ds"
]
},
{
"cell_type": "code",
"execution_count": 90,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"villes = [\"Chiconi\", \"Sada\", \"Kaweni\", \"Dzaoudzi\", \"Bandrele\"]"
]
},
{
"cell_type": "code",
"execution_count": 91,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"ind = np.arange(5)\n",
"width = 0.5"
]
},
{
"cell_type": "code",
"execution_count": 92,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# Set the font dictionaries (for plot title and axis titles)\n",
"title_font = {'fontname':'Droid Sans Mono Slashed for Powerline', 'size':'20', 'color':'black', 'weight':'normal',\n",
" 'verticalalignment':'bottom'} # Bottom vertical alignment for more space\n",
"axis_font = {'fontname':'Droid Sans Mono Slashed for Powerline', 'size':'16', 'color':'black', 'weight':'normal'}"
]
},
{
"cell_type": "code",
"execution_count": 93,
"metadata": {
"collapsed":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YGZmZnhhMDMzMxwQmBmZmY4ITAzMzOcEJiZmRlOCMzM\nzAwnBGZmZoYTAjMzM8MJgZmZmeGEwMzMzHBCYGZmZsD4Mt9c0nxgCbACWB4Ru0maAJwDbA3MBz4S\nEUtKC9LMzGwMKLuFYAUwNSJ2jojdsmlHA1dFRCcwG/hmadGZmZmNEWUnBKoRw/uBWdnzWcAHmhqR\nmZnZGFR2QhDA5ZJukfSZbNqkiFgIEBELgE1Li87MzGyMKLUPAfCmiFggaVPgCklzSEmCmZmZNVGp\nLQRZCwARsQj4HbAbsFDSJABJmwOPN1KXpBcfU6dOpaur68V5XV1dHve4xz3ucY+PuvEiKaKcP+SS\n1gXWiIhnJa0HXAEcC+wFPBkRJ0o6CpgQEUcPUleU9TnMzMxKoMIrLDEh2Ba4gHSIYDxwVkScIGlj\n4Fzg5cBDwAER8dQgdTkhMDOzsWT0JARFckJgZmZjTOEJQdlnGZiZmVkLcEJgZmZmTgjMzMzMCYGZ\nmZnhhMDMzMwo/0qFhenp6Sk7hGGbPHky48aNKzsMMzMbg0ZNQtDZWXYEwzWPOXOgo6Oj7EDMzGwM\nGjUJAXhHamZmNlTuQ2BmZmaNJwSSVisraX1JO0t6SbFhmZmZWTPlaSE4WdJJ/SOSXgfMA24D5mfj\nZmZm1obyJATvBOZWjP8EuB/YCbgdOL7AuMzMzKyJ8nQq3BK4D0DSa4EpwC4R8RdJJwOnjUB8ZmZm\n1gR5WgieAfr7CnwB+GNE3JmNPwu8tMjAzMzMrHnytBBcB3xb0uuBQ4CDKuZtCywqMjAzMzNrnjwt\nBF8jJRDfAn4eEb+pmPde4IYiAzMzM7PmabiFICIeBHavM/sI0iEFMzMza0OFXJgoIh6NiCElBJLW\nkHSHpN9n42dI+ls27fb
"text/plain": [
"<matplotlib.figure.Figure at 0x7fca864db9b0>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, ax = plt.subplots()\n",
"bar = ax.bar(ind, ds, width) \n",
"\n",
"ax.set_title('Visites des 5e', **title_font)\n",
"\n",
"ax.set_ylabel('Nombre de visiteurs', **axis_font)\n",
"ax.set_yticks(np.arange(0, 61, 5))\n",
"ax.set_xticks(ind + width/2)\n",
"ax.set_xticklabels(villes, **axis_font)\n",
"\n",
"ax.yaxis.grid(True)\n",
"\n",
"ax.spines['right'].set_visible(False)\n",
"ax.spines['top'].set_visible(False)\n",
"\n",
"ax.yaxis.set_ticks_position('left')\n",
"ax.xaxis.set_ticks_position('bottom')\n",
"\n",
"\n",
"fig.savefig(\"./graph1.pdf\")\n"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"## Sortie en mer"
]
},
{
"cell_type": "code",
"execution_count": 94,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[6, 17, 15, 26, 12]"
]
},
"execution_count": 94,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ds = pm.Dataset.random(5, distrib=\"randint\", rd_args=(5, 30))\n",
"ds"
]
},
{
"cell_type": "code",
"execution_count": 117,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"obs = [\"Boutielles\", \"Poisson \\n Clown\", \"Poisson \\n Soldat\", \"Corail \\n Branche\", \"Corail \\n Mou\"]"
]
},
{
"cell_type": "code",
"execution_count": 109,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"ind = np.arange(5)\n",
"width = 0.7"
]
},
{
"cell_type": "code",
"execution_count": 118,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# Set the font dictionaries (for plot title and axis titles)\n",
"title_font = {'fontname':'Droid Sans Mono Slashed for Powerline', 'size':'20', 'color':'black', 'weight':'normal',\n",
" 'verticalalignment':'bottom'} # Bottom vertical alignment for more space\n",
"axis_font = {'fontname':'Droid Sans Mono Slashed for Powerline', 'size':'14', 'color':'black', 'weight':'normal'}"
]
},
{
"cell_type": "code",
"execution_count": 119,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSU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0r05P7DPwDczM2tQ2zv0nDlpr4jYCdgROEDSbsBXgLMiYivSZTcf\na3dsZmZmnaqUXe4R0Zdk45Wka+ED2Av4SR5+Mek6WjMzM2tAKR26pFXyXaEeJ+WKng3ML+SAfhRY\n4RaHZmZmVl8px6lzx72TpLVJd6zapt5kQ9UjablpJk+ezJ577skpp5wC4Gc/+9nPfvZztz0PeOvh\n0u8UJ+lkUuKBzwMbRsRSSW8k3R/6gCHmXck0yWZmZh1lwA69jLPc15O0Tn69GimF5l3AdOA9ebLD\ngJ+2OzYzM7NO1fYtdEmTSCe9rZIfP4qIL0vaHLiElDXoduCDEfHyEHV5C93MzEaT6u5yXxnu0M3M\nbJSpzi53MzMzaz136GZmZl3AHbqZmVkXcIduZmbWBdyhm5mZdQF36GZmZl2gjBvLbCzpGkl35fSp\nR+fhO0i6MadVvUXSG9odm5mZWacq48YyG5Ju8TpD0prAraTMaueQ0qdeJekA4PMRsdcQdfk6dDMz\nG00GvA59bDujAIiIx0lZ1oiI5yXdQ8qsthRYJ082DpjT7tjMzMw6Val3ipO0GXAtsB2wMfBr0r8P\nAW+OiEeGmN9b6GZmNppU705xeXf7pcAxEfE88Kn8ehPgs8CFDdbT/yimToWUbs5ll1122WWXu61c\nTylb6JLGAlcAv4yIr+dh8yNiXGGaZyNinYHqyNN4C93MzEaTym2hXwjc1deZZ3MkTQaQtA8wq5TI\nzMzMOlAZZ7nvDvwWmAlEfpwALADOBcYAi4AjI+L2IeryFrqZmY0mTp9qZmbWBSq3y93MzMxayB26\nmZlZF3CHbmZm1gXcoZu
"text/plain": [
"<matplotlib.figure.Figure at 0x7fca8681f518>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, ax = plt.subplots(figsize = (8,4))\n",
"ax.bar(ind, ds, width, color=\"lightgray\")\n",
"\n",
"ax.set_title('Observations en mer', **title_font)\n",
"\n",
"ax.set_ylabel('Quantité', **axis_font)\n",
"ax.set_yticks(np.arange(0, 31, 2))\n",
"ax.set_xticks(ind + width/2)\n",
"ax.set_xlim(0, 4.8)\n",
"ax.set_xticklabels(obs, **axis_font)\n",
"\n",
"ax.yaxis.grid(True)\n",
"\n",
"ax.spines['right'].set_visible(False)\n",
"ax.spines['top'].set_visible(False)\n",
"\n",
"ax.yaxis.set_ticks_position('left')\n",
"ax.xaxis.set_ticks_position('bottom')\n",
"\n",
"\n",
"#fig.savefig(\"./fig/graph_poisson.pdf\")"
]
},
{
"cell_type": "markdown",
"metadata": {
"collapsed": true
},
"source": [
"## Olympiades de math"
]
},
{
"cell_type": "code",
"execution_count": 80,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[9, 19, 10, 9, 10, 13, 6]"
]
},
"execution_count": 80,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ds = pm.Dataset.random(7, distrib=\"randint\", rd_args=(2, 30))\n",
"ds"
]
},
{
"cell_type": "code",
"execution_count": 116,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"[9, 19, 9, 10, 10, 13, 6]"
]
},
"execution_count": 116,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"ds = pm.Dataset([9, 19, 9, 10, 10, 13, 6])\n",
"ds"
]
},
{
"cell_type": "code",
"execution_count": 117,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"villes = [\"Sada\", \"Majicavo\", \"Chiconi\", \"Kaweni1\", \"Bandrélé\", \"Bouéni\", \"Pamandzi\"]"
]
},
{
"cell_type": "code",
"execution_count": 118,
"metadata": {
"collapsed": false
},
"outputs": [],
"source": [
"ind = np.arange(7)\n",
"width = 0.7"
]
},
{
"cell_type": "code",
"execution_count": 119,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"# Set the font dictionaries (for plot title and axis titles)\n",
"title_font = {'fontname':'Droid Sans Mono Slashed for Powerline', 'size':'20', 'color':'black', 'weight':'normal',\n",
" 'verticalalignment':'bottom'} # Bottom vertical alignment for more space\n",
"axis_font = {'fontname':'Droid Sans Mono Slashed for Powerline', 'size':'14', 'color':'black', 'weight':'normal'}"
]
},
{
"cell_type": "code",
"execution_count": 120,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAfgAAAEcCAYAAAAr/abrAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmYHFW9//H3x6CAiIYbZAtLJDgsEkBlUVQSREVxxys/\nzVUwLqi468UFlYwbKPcqyOjoRQVFHUW5CuJ2UQmbssmiAcGBwAAGCRAIexCS7++PU51UOj3d1d3V\n0z2dz+t5+umupU99z+mqOlWnTlUrIjAzM7P+8rhuB2BmZmblcwVvZmbWh1zBm5mZ9SFX8GZmZn3I\nFbyZmVkfcgVvZmbWh1zBryMkHSZpZdVrs27H1QpJp0m6Q9JWE7Cs2VlZHd3pZXXCZI+/DJIGszI4\nqI00zs/SOLzM2CbCRG4v1ltcwU9ikg6V9EdJ90q6X9Jlkt4+zuxnAvsBBwPXAZP5AQhbAhsDG3Q7\nEFubpLGsMvxujWk/yKbdWNKyPiBpQYPZgjbWd0lvBp4HfDkiTmo1nTIUzG81by/rKFfwk5SkIeC7\nwDbAd4Ah4AnASZLW2glFxLKIuDAizgCWTGSsHfBiYOuIKKWSsNIFsBLYp8a0vYBHSlzWbDp4sCpp\nKvBp4JMRcWSnltOEVvLr7WUdtV63A7DmSdofeA+wEHheRDyQjf8U8HPgbZJ+ERG/7GKYHRMRj1Bu\nJWHluxbYWdKTI+I+AEmbAE8Hzge2bXcBkh4HvIC0HXRERCwDBjqVfjNaza+3l3WXz+Anp3eSjuI/\nXqncASJiJfBhQMD7WklY0gaS7pH0tzrz/FXSA5I2krRd1uQ6W9KPs0sFP5I0RdKx2eWDiyVtm/t+\n5ZroUyR9QtIiSQ9LulbSe8ZZ5tuq+g+saJCP3SWdIOkvWQwPSbpG0nxJTxjnO+/O5nlY0k2SBkmt\nIuMt48WS/iBpWZb+lZL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ei\n0r3wu5OapWsZo7nfC1j1EJoHgKdLKrM18rt0tnzG6K381lt/Kpfl8kZJ8a/REVbSM6m63TDzXXpr\ne1lnuIl+EoqI8yR9jfQ0u6slnU661vly0lnxtyLiN5X5JW0IvKQyyOoevS+TVDkavy4i/l5jcSeR\n7lt9CnBWRNxbY55WPQBcKelMUjPhq0lPOPt01jw3XvwbZ+NfnUsrH/8PgE8B/yVpd9IZxz7As4DT\nSZcaVomI2yQdm33nMkm/IG0br8ziUtX8SyQdRuqhvlDST0m3E21JOgvam3R2c1/ua9dnzdVXALeR\nyvOg7DufLFpgtUxQ/K26CNiQtFMer4m+qd+ryk9ITd7nSjqblO+pEfH+qvnqdRSb6PLpaH6b3V4a\nrD+3sHanyLNJLWwvk3QuqSf8tlnc5+WWTZZ+T20v65Ru36fnV+sv4FDSwy/uJV2zvgSYV2O+yr26\nK+q8jh5nGU8k7YBWAAeNk/YKUqVcGXcT8Ifc8CnAY7nhyn20LyY9hGOM1PP4GuBdZcQP7Em6338Z\nqWPPb0jNhy/M5t+2xnLeS2quXA7cTOrlvCnp7ObTNebfHfgRaQe0PHs/H/goVfc5kx7a8ecsln+R\nHgLzB+C1Ja4PHYu/yThuZM37pm8F/lL1+1ffB9/075VbP/+b1N9kOakj3W+q5mnqvu1myqeV9X8C\n8tvS9k56+uV1pG3xBtJTMV+VpVW9fW1B6mx7M+ns/CrS2f4e7ZTnRG4v68JLWWGajUvSdaQj6OmR\nu3+3jfTmk26D2T8izm83PTPrDEkHk1oVBiPis92Ox5rja/BWl6TnkHrlf6+Myt3MJpUy/pfAusQV\nvI1L6Yblz5CayNrutGdmZhPHnexsLZK+QuoAtz+wL+n6223djcrMzJrhCt5qOZj0MInFwMci4r+7\nHI+ZdU/Q3mOvrUsmvJN
"text/plain": [
"<matplotlib.figure.Figure at 0x7fd89a852470>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"fig, ax = plt.subplots(figsize = (8,4))\n",
"ax.bar(ind, ds, width, color=\"lightgray\")\n",
"\n",
"ax.set_title('Olympiades de Mathématiques', **title_font)\n",
"\n",
"ax.set_ylabel('Nombre de médailles', **axis_font)\n",
"ax.set_yticks(np.arange(0, max(ds)+2, 2))\n",
"ax.set_xticks(ind + width/2)\n",
"ax.set_xlim(0, 6.8)\n",
"ax.set_xticklabels(villes, **axis_font)\n",
"\n",
"ax.yaxis.grid(True)\n",
"\n",
"ax.spines['right'].set_visible(False)\n",
"ax.spines['top'].set_visible(False)\n",
"\n",
"ax.yaxis.set_ticks_position('left')\n",
"ax.xaxis.set_ticks_position('bottom')\n",
"\n",
"fig.savefig(\"./fig/graph_medailles.pdf\")"
]
},
{
"cell_type": "code",
"execution_count": 121,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>Nombre de cadeaux</th>\n",
" </tr>\n",
" <tr>\n",
" <th>Villes</th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Sada</th>\n",
" <td>9</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Majicavo</th>\n",
" <td>19</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Chiconi</th>\n",
" <td>9</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Kaweni1</th>\n",
" <td>10</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Bandrélé</th>\n",
" <td>10</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Bouéni</th>\n",
" <td>13</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pamandzi</th>\n",
" <td>6</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" Nombre de cadeaux\n",
"Villes \n",
"Sada 9\n",
"Majicavo 19\n",
"Chiconi 9\n",
"Kaweni1 10\n",
"Bandrélé 10\n",
"Bouéni 13\n",
"Pamandzi 6"
]
},
"execution_count": 121,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df = pd.DataFrame(data=list(ds), index=villes,columns=['Nombre de cadeaux'])\n",
"df.index.name=\"Villes\"\n",
"df"
]
},
{
"cell_type": "code",
"execution_count": 122,
"metadata": {
"collapsed": false
},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"\\begin{tabular}{lrrrrrrr}\n",
"\\toprule\n",
"Villes & Sada & Majicavo & Chiconi & Kaweni1 & Bandrélé & Bouéni & Pamandzi \\\\\n",
"\\midrule\n",
"Nombre de cadeaux & 9 & 19 & 9 & 10 & 10 & 13 & 6 \\\\\n",
"\\bottomrule\n",
"\\end{tabular}\n",
"\n"
]
}
],
"source": [
"print(df.T.to_latex())"
]
},
{
"cell_type": "code",
"execution_count": 123,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"\n",
"title_font = {'fontname':'Droid Sans Mono Slashed for Powerline', 'size':'23', 'color':'black', 'weight':'normal',\n",
" 'verticalalignment':'bottom'} # Bottom vertical alignment for more space\n",
"axis_font = {'fontname':'Droid Sans Mono Slashed for Powerline', 'size':'14', 'color':'black', 'weight':'normal'}"
]
},
{
"cell_type": "code",
"execution_count": 124,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAAAs0AAAEkCAYAAADU7AxWAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzs3XmYHFXZ/vHvnQCRTZAdghKIDrIFBAQMQoIiIBgWQcAg\nq4oCIgqiIgKDxA0FhWjQFyWsEQFFZPkhCAHEFwQF2WUwZAQCvpCwQ0K25/fHOT3pdLqnp2e6pifk\n/lxXX9VV51Sd06erq5+uPlVHEYGZmZmZmdU2qNUVMDMzMzMb6Bw0m5mZmZnV4aDZzMzMzKwOB81m\nZmZmZnU4aDYzMzMzq8NBs5mZmZlZHQ6azRok6aOS5lc8Olpdr2aTtLKkqZL+LkktK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KliGdcb6gVn5J+5N+4C1F2seeIF0QOJf0j8kWzapbme7asppSW95F\n9/8mPVdlWcOft7z/fIm0/79Jev9eJXVBGEaTfpz2QW/3yd56J6kt/gX8Xzf5gvzDpGtBxL+VRkb8\nAvBlYGfgY8A0SadExIVNrKdZQxw025KqAxgKtHWTpzQAw6PNKDAipkv6I/BJUh/Cy0kB8wrAb6ud\nAeqj7rqVlILlZnxRnk0KmB8G9omIKeWJ+cxSpdLZ+8q/ZstVO7NUqu9tEXFQoxUFiIg/An+UtBHw\nRdLtvr4JbA7s0ZttVmjZa+uDe4GtlO5JvgrpTgeLULpV4Xmks6yXA0eXdyVRGiFzcvHVresNUuB2\nWJTdg70IkrZmQcD8ddIw3XPL0k8j9c1upd7uk/XU+tFd2pd/GhHnN7rRiJhNumB3vKSPkNp3L+AC\nSWtExJm9qKtZn7l7hi2
"text/plain": [
"<matplotlib.figure.Figure at 0x7fd89a629940>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"ax = df.plot(kind='bar', color='lightgrey', figsize=(12,4), rot=0, fontsize=20)\n",
"\n",
"ax.set_title('Olympiades de Mathématiques', **title_font)\n",
"\n",
"ax.set_yticks(np.arange(0, max(ds)+2, 2))\n",
"ax.set_xlabel('')\n",
"#ax.set_xticks(ind + width/2)\n",
"ax.yaxis.grid(True)\n",
"\n",
"ax.spines['right'].set_visible(False)\n",
"ax.spines['top'].set_visible(False)\n",
"ax.yaxis.set_ticks_position('left')\n",
"ax.xaxis.set_ticks_position('bottom')\n",
"\n",
"fig = ax.get_figure()\n",
"fig.savefig(\"./fig/graph_medailles.pdf\")"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.5.1"
}
},
"nbformat": 4,
"nbformat_minor": 0
}