{ "metadata": { "name": "", "signature": "sha256:f457c5b80ae013f0b0110f6c10fdbc7f0b10d193597373e11b0aaabd527f8b1d" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "# Traitement de donn\u00e9es avec pandas\n", "\n", "\n", "\n", "[Pandas](http://pandas.pydata.org/) est une biblioth\u00e8que de donn\u00e9es.\n", "\n", "- Donn\u00e9es uni-dimensionnelles et temporelles (Series),\n", "- Donn\u00e9es bi-dimensionnelles (DataFrame),\n", "- Traitement\u202f: indexation, extraction, allignement, regroupement, jointures,\n", "- Tr\u00e8s efficace (code critique \u00e9crit en C/Cython),\n", "- Dessin (via matplotlib)\n", "- Parfaitement int\u00e9gr\u00e9 avec IPython." ] }, { "cell_type": "code", "collapsed": false, "input": [ "import pandas as pd\n", "import numpy as np\n", "import matplotlib.pyplot as plt" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Donn\u00e9es uni-dimensionnelles\n", "\n", "Des tableaux *homog\u00e8nes*, bas\u00e9s sur les *arrays numpy*.\n", "\n", "- Plus efficaces que les listes\n", "- Op\u00e9rations \u00e9l\u00e9ment-par-\u00e9l\u00e9ment (comme les arrays numpy)" ] }, { "cell_type": "code", "collapsed": false, "input": [ "s = pd.Series(range(10))\n", "s" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 2, "text": [ "0 0\n", "1 1\n", "2 2\n", "3 3\n", "4 4\n", "5 5\n", "6 6\n", "7 7\n", "8 8\n", "9 9\n", "dtype: int64" ] } ], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": [ "10*s" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 3, "text": [ "0 0\n", "1 10\n", "2 20\n", "3 30\n", "4 40\n", "5 50\n", "6 60\n", "7 70\n", "8 80\n", "9 90\n", "dtype: int64" ] } ], "prompt_number": 3 }, { "cell_type": "code", "collapsed": false, "input": [ "s * s" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 4, "text": [ "0 0\n", "1 1\n", "2 4\n", "3 9\n", "4 16\n", "5 25\n", "6 36\n", "7 49\n", "8 64\n", "9 81\n", "dtype: int64" ] } ], "prompt_number": 4 }, { "cell_type": "markdown", "metadata": {}, "source": [ "M\u00e9thode .plot(), appelle matplotlib" ] }, { "cell_type": "code", "collapsed": false, "input": [ "# toujours cette ligne dans IPython pour afficher les graphiques\n", "%matplotlib inline" ], "language": "python", "metadata": {}, "outputs": [], "prompt_number": 5 }, { "cell_type": "code", "collapsed": false, "input": [ "x = s * s\n", "x.plot()" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 6, "text": [ "" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAW8AAAEACAYAAAB8nvebAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAIABJREFUeJzt3XmUXHWZ//H3Q0LQAGMTOZMEITRyjKABG0GHLVJg8LCY\nuEGEcUlH4cwZRYjwcwgyjoDDPoxBkRnRhG7CIquBiE4SYirLiEJIWgMhRP0lypYOEIMoBprwzB/3\nNikqle5vdy33W1Wf1zl1ur7Vt6o+53b3U7efu3zN3RERkfqyU9YBRERk4FS8RUTqkIq3iEgdUvEW\nEalDKt4iInVIxVtEpA71W7zN7BwzW2Vmj5rZOeljI8xsgZmtNbP5ZtZS/agiItKrz+JtZuOAM4AP\nAO8DPmpm+wPTgQXuPhZYmI5FRKRG+tvyPgD4lbtvcfetwGLgU8AkoDNdphP4ePUiiohIsf6K96PA\n+LRNMhw4CdgbGOnu3eky3cDIKmYUEZEiQ/v6pruvMbMrgfnAX4EuYGvRMm5mOsdeRKSG+izeAO4+\nC5gFYGaXAk8B3WY2yt03mNloYGOp56qoi4gMjrtbX98POd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t4hIHVLxFhGpQyre\nIiJ1SMVbRKQO/R+jw4PtrzdqcAAAAABJRU5ErkJggg==\n", "text": [ "" ] } ], "prompt_number": 6 }, { "cell_type": "markdown", "metadata": {}, "source": [ "L'abscisse est appel\u00e9e *index* dans le jargon de pandas.\n", "\n", "Elle peut contenir tout type de donn\u00e9es, mais ses valeurs doivent \u00eatre uniques." ] }, { "cell_type": "code", "collapsed": false, "input": [ "t = pd.Series([1,2,3], ['a', 'b', 'c'])\n", "t" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 7, "text": [ "a 1\n", "b 2\n", "c 3\n", "dtype: int64" ] } ], "prompt_number": 7 }, { "cell_type": "code", "collapsed": false, "input": [ "t.plot()" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 8, "text": [ "" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAXEAAAEACAYAAABF+UbAAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAEHlJREFUeJzt3V+IXOd5x/Hfz5XbGkK7LQGpsWX2Ik5LQoLUlESOU3nV\nUqh1IXKRkrQsZlNoBa0SQ8iFIAZDoOQiLbgGE/nC8ToNxLSSGpxU6U3rETY1Kkm0Qo6cYpMI5EKE\ngiyDI6KbPr3YkTQZz5m/77znvOd8PzBoz867My+PRo8e/ebMkSNCAIAy3VH3BgAA86OJA0DBaOIA\nUDCaOAAUjCYOAAWjiQNAwcY2cdu/bvuM7S3bF2x/uWLdE7Zfs33O9t7lbBUAMGzHuDsj4he2D0TE\ndds7JL1k++MR8dLNNbYPSnpvRNxn+6OSvipp33K3DQCQpohTIuJ6/8tflfQrkq4OLTkk6dn+2jOS\nVmzvTLlJAMBoE5u47Ttsb0m6LOmFiLgwtORuSZcGjt+QdE+6LQIAqkwzif9fROzRdmPeb3ttxDIP\n/1iCvQEAJhibiQ+KiLds/5ukP5DUG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Mm+AXRF6zJx\npm8AuK2YJt7F7LsKmWNa1DMt6plXEU2c6RsARmt0Jk72DaDris3Emb4BYLLGNXGy78nIHNOinmlR\nz7wa1cSZvgFgNo3IxMm+AWC0xmfiTN8AML+JTdz212xftn1+zJonbL9m+5ztvdM8Mdn3/Mgc06Ke\naVHPvKaZxJ+R9KdVd9o+KOm9EXGfpL+W9NVJD8j0vZitra26t9Aq1DMt6pnXjkkLIuJF26tjlhyS\n9Gx/7RnbK7Z3RsTl4YWD2ffJkzTveV27dq3uLbQK9UyLeuaVIhO/W9KlgeM3JN0zaiHTNwCkNXES\nn9LwO6cjT0Nh+k7j4sWLdW+hVahnWtQzr6lOMezHKd+OiA+OuO+YpF5EPNc//pGkB4fjFNt5zmUE\ngJYZd4phikn8eUlHJD1ne5+ka6Py8HGbAADMZ2ITt/1NSQ9KerftS5Iek3SnJEXEUxFxyvZB269L\n+rmkzyxzwwCA27J9YhMAkF7tn9gE6mJ7ddyH2IAS0MQBoGBLb+K2/9X292y/Yvuvlv18wIx22P6G\n7Qu2/8U2F39AI9h+uH8pky3bX69ct+xM3PZvRcSb/T8c/63t0w+vLvVJgSn0T539saQHIuJl209L\nuhAR/1DrxtB5tj8g6aSk+yPi6s0+OmptjjjlEdtbkl7W9ic578vwnMC0LkXEy/2vvyHp43VuBuj7\nI0n/fHPgrWrgUrpPbI5ke03SH0vaFxG/sP2CpF9b5nMCMxr8p6hV8WljILPQOz8JP9KyJ/HfkPRm\nv4H/nqR9S34+YFb39j+kJkl/IenFOjcD9P2npD+z/duSdPPXUZbdxP9d228cXZD0ZW1HKkBThKT/\nkfS3/dfob2qKSykDyxYRFyT9naTT/Tj676vW8mEfACgY54kDQMFo4gBQMJo4ABSMJg4ABaOJA0DB\naOIAUDCaOAAUjCYOAAX7f5NxquUqixlNAAAAAElFTkSuQmCC\n", "text": [ "" ] } ], "prompt_number": 8 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Les Series se comportent comme des tableaux associatifs" ] }, { "cell_type": "code", "collapsed": false, "input": [ "t['b']" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 9, "text": [ "2" ] } ], "prompt_number": 9 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Support pour les dates" ] }, { "cell_type": "code", "collapsed": false, "input": [ "pd.Series(range(10,0,-1), index=pd.date_range('2015-3-23', periods=10)).plot()" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 10, "text": [ "" ] }, { "metadata": {}, "output_type": "display_data", "png": "iVBORw0KGgoAAAANSUhEUgAAAXgAAAEXCAYAAACnP18pAAAABHNCSVQICAgIfAhkiAAAAAlwSFlz\nAAALEgAACxIB0t1+/AAAF11JREFUeJzt3X+UpXV92PH3BxYim6XeUhWN4BniwR8NS4ZVCSeReJ2j\nDRI2aFoET2pnzLGNbIp0TRRtTclpT1WINjZ1Q9s4zKAFE4VIiSUJJOGpsQkIuisrP6QaOYjGxcSO\n2Q3QWvn0j/vsehl2ZmfuPPd5nnvv+3XOnp3n3mfu/TAz++U9z33uvZGZSJLGz1FNDyBJGg4XeEka\nUy7wkjSmXOAlaUy5wEvSmHKBl6QxteoCHxFXR8S+iNjbd9kJEXFrRDwQEbdERGf4Y0qS1utIBb8A\nnLPssncCt2bmC4A/LrclSS0TR3qiU0RMAb+XmVvL7fuBV2Tmvoh4NlBk5ouGPagkaX0GOQZ/Ymbu\nKz/eB5xY4TySpIps2sgnZ2ZGxGF/BVjpcknS6jIzqridQQr+4KEZIuI5wCMr7XjSScnFFyf79yeZ\nzf+5/PLLG59hFGZq61zO5EyTMFeVBlngbwJmy49ngRtX2nHvXnj8cdi6Ff7kTwYZr1rdbrfpEZ6i\njTNBO+dyprVxprVr61xVWfVB1oj4GPAK4Bn0jrf/a+C/AR8Hngc8CLw+M5cO87l58LZvvhl+4Rdg\n+3a48krYsqXq/wxJGg8RQVZ0iOaIZ9EMfMN9CzzA0hK87W1w220wPw8zM0O5W0ka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5n5ixWanp4sAAAAAElFTkSuQmCC\n", "text": [ "" ] } ], "prompt_number": 10 }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Donn\u00e9es bi-dimensionnelles" ] }, { "cell_type": "code", "collapsed": false, "input": [ "d = pd.DataFrame({\n", " 'Pression' : range(10, 22),\n", " 'Temperature' : np.random.randn(12)\n", "})\n", "d" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PressionTemperature
0 10-0.842207
1 11-0.703170
2 12-0.787609
3 13 0.877794
4 14-1.113236
5 15-0.130890
6 16 0.038141
7 17 0.072686
8 18 0.689185
9 19 0.139529
10 20 1.711627
11 21 0.554641
\n", "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PressionTemperature
2 12-0.787609
3 13 0.877794
4 14-1.113236
5 15-0.130890
6 16 0.038141
\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 15, "text": [ " Pression Temperature\n", "2 12 -0.787609\n", "3 13 0.877794\n", "4 14 -1.113236\n", "5 15 -0.130890\n", "6 16 0.038141" ] } ], "prompt_number": 15 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Ordonner" ] }, { "cell_type": "code", "collapsed": false, "input": [ "d.sort(columns=\"Temperature\")" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PressionTemperature
4 14-1.113236
0 10-0.842207
2 12-0.787609
1 11-0.703170
5 15-0.130890
6 16 0.038141
7 17 0.072686
9 19 0.139529
11 21 0.554641
8 18 0.689185
3 13 0.877794
10 20 1.711627
\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 16, "text": [ " Pression Temperature\n", "4 14 -1.113236\n", "0 10 -0.842207\n", "2 12 -0.787609\n", "1 11 -0.703170\n", "5 15 -0.130890\n", "6 16 0.038141\n", "7 17 0.072686\n", "9 19 0.139529\n", "11 21 0.554641\n", "8 18 0.689185\n", "3 13 0.877794\n", "10 20 1.711627" ] } ], "prompt_number": 16 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Statistiques" ] }, { "cell_type": "code", "collapsed": false, "input": [ "d.max()" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 17, "text": [ "Pression 21.000000\n", "Temperature 1.711627\n", "dtype: float64" ] } ], "prompt_number": 17 }, { "cell_type": "code", "collapsed": false, "input": [ "d.describe()" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PressionTemperature
count 12.000000 12.000000
mean 15.500000 0.042208
std 3.605551 0.829465
min 10.000000 -1.113236
25% 12.750000 -0.724280
50% 15.500000 0.055413
75% 18.250000 0.588277
max 21.000000 1.711627
\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 18, "text": [ " Pression Temperature\n", "count 12.000000 12.000000\n", "mean 15.500000 0.042208\n", "std 3.605551 0.829465\n", "min 10.000000 -1.113236\n", "25% 12.750000 -0.724280\n", "50% 15.500000 0.055413\n", "75% 18.250000 0.588277\n", "max 21.000000 1.711627" ] } ], "prompt_number": 18 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Les tableaux sont modifiables" ] }, { "cell_type": "code", "collapsed": false, "input": [ "d['Pression'] = np.random.randn(12)\n", "d" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PressionTemperature
0 0.184172-0.842207
1 -0.662485-0.703170
2 -0.577594-0.787609
3 1.090871 0.877794
4 -0.433989-1.113236
5 -0.903735-0.130890
6 -0.250935 0.038141
7 0.744094 0.072686
8 1.663164 0.689185
9 0.874518 0.139529
10 0.648450 1.711627
11-1.518451 0.554641
\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 19, "text": [ " Pression Temperature\n", "0 0.184172 -0.842207\n", "1 -0.662485 -0.703170\n", "2 -0.577594 -0.787609\n", "3 1.090871 0.877794\n", "4 -0.433989 -1.113236\n", "5 -0.903735 -0.130890\n", "6 -0.250935 0.038141\n", "7 0.744094 0.072686\n", "8 1.663164 0.689185\n", "9 0.874518 0.139529\n", "10 0.648450 1.711627\n", "11 -1.518451 0.554641" ] } ], "prompt_number": 19 }, { "cell_type": "code", "collapsed": false, "input": [ "d['Volume'] = range(12,0,-1)\n", "d" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PressionTemperatureVolume
0 0.184172-0.842207 12
1 -0.662485-0.703170 11
2 -0.577594-0.787609 10
3 1.090871 0.877794 9
4 -0.433989-1.113236 8
5 -0.903735-0.130890 7
6 -0.250935 0.038141 6
7 0.744094 0.072686 5
8 1.663164 0.689185 4
9 0.874518 0.139529 3
10 0.648450 1.711627 2
11-1.518451 0.554641 1
\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 20, "text": [ " Pression Temperature Volume\n", "0 0.184172 -0.842207 12\n", "1 -0.662485 -0.703170 11\n", "2 -0.577594 -0.787609 10\n", "3 1.090871 0.877794 9\n", "4 -0.433989 -1.113236 8\n", "5 -0.903735 -0.130890 7\n", "6 -0.250935 0.038141 6\n", "7 0.744094 0.072686 5\n", "8 1.663164 0.689185 4\n", "9 0.874518 0.139529 3\n", "10 0.648450 1.711627 2\n", "11 -1.518451 0.554641 1" ] } ], "prompt_number": 20 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Transpos\u00e9e" ] }, { "cell_type": "code", "collapsed": false, "input": [ "d.T" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
01234567891011
Pression 0.184172 -0.662485 -0.577594 1.090871-0.433989-0.903735-0.250935 0.744094 1.663164 0.874518 0.648450-1.518451
Temperature -0.842207 -0.703170 -0.787609 0.877794-1.113236-0.130890 0.038141 0.072686 0.689185 0.139529 1.711627 0.554641
Volume 12.000000 11.000000 10.000000 9.000000 8.000000 7.000000 6.000000 5.000000 4.000000 3.000000 2.000000 1.000000
\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 21, "text": [ " 0 1 2 3 4 5 \\\n", "Pression 0.184172 -0.662485 -0.577594 1.090871 -0.433989 -0.903735 \n", "Temperature -0.842207 -0.703170 -0.787609 0.877794 -1.113236 -0.130890 \n", "Volume 12.000000 11.000000 10.000000 9.000000 8.000000 7.000000 \n", "\n", " 6 7 8 9 10 11 \n", "Pression -0.250935 0.744094 1.663164 0.874518 0.648450 -1.518451 \n", "Temperature 0.038141 0.072686 0.689185 0.139529 1.711627 0.554641 \n", "Volume 6.000000 5.000000 4.000000 3.000000 2.000000 1.000000 " ] } ], "prompt_number": 21 }, { "cell_type": "markdown", "metadata": {}, "source": [ "S\u00e9lectionner des colonnes" ] }, { "cell_type": "code", "collapsed": false, "input": [ "d[['Pression', 'Volume']]" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PressionVolume
0 0.184172 12
1 -0.662485 11
2 -0.577594 10
3 1.090871 9
4 -0.433989 8
5 -0.903735 7
6 -0.250935 6
7 0.744094 5
8 1.663164 4
9 0.874518 3
10 0.648450 2
11-1.518451 1
\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 22, "text": [ " Pression Volume\n", "0 0.184172 12\n", "1 -0.662485 11\n", "2 -0.577594 10\n", "3 1.090871 9\n", "4 -0.433989 8\n", "5 -0.903735 7\n", "6 -0.250935 6\n", "7 0.744094 5\n", "8 1.663164 4\n", "9 0.874518 3\n", "10 0.648450 2\n", "11 -1.518451 1" ] } ], "prompt_number": 22 }, { "cell_type": "markdown", "metadata": {}, "source": [ "Les tableaux aussi s'additionnent composante par composante" ] }, { "cell_type": "code", "collapsed": false, "input": [ "d+d" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
PressionTemperatureVolume
0 0.368343-1.684414 24
1 -1.324969-1.406340 22
2 -1.155188-1.575218 20
3 2.181742 1.755588 18
4 -0.867978-2.226472 16
5 -1.807470-0.261780 14
6 -0.501871 0.076282 12
7 1.488188 0.145372 10
8 3.326329 1.378370 8
9 1.749037 0.279058 6
10 1.296901 3.423255 4
11-3.036902 1.109281 2
\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 23, "text": [ " Pression Temperature Volume\n", "0 0.368343 -1.684414 24\n", "1 -1.324969 -1.406340 22\n", "2 -1.155188 -1.575218 20\n", "3 2.181742 1.755588 18\n", "4 -0.867978 -2.226472 16\n", "5 -1.807470 -0.261780 14\n", "6 -0.501871 0.076282 12\n", "7 1.488188 0.145372 10\n", "8 3.326329 1.378370 8\n", "9 1.749037 0.279058 6\n", "10 1.296901 3.423255 4\n", "11 -3.036902 1.109281 2" ] } ], "prompt_number": 23 }, { "cell_type": "markdown", "metadata": {}, "source": [ "## S\u00e9lectionner" ] }, { "cell_type": "code", "collapsed": false, "input": [ "a = pd.DataFrame({\n", " 'qui' : ['Jean', 'Garfield', 'Milou', 'Bob'],\n", " 'espece' : ['homme', 'chat', 'chien', 'chien']\n", "})\n", "a" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
especequi
0 homme Jean
1 chat Garfield
2 chien Milou
3 chien Bob
\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 24, "text": [ " espece qui\n", "0 homme Jean\n", "1 chat Garfield\n", "2 chien Milou\n", "3 chien Bob" ] } ], "prompt_number": 24 }, { "cell_type": "code", "collapsed": false, "input": [ "a[a.espece == 'chien']" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
especequi
2 chien Milou
3 chien Bob
\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 25, "text": [ " espece qui\n", "2 chien Milou\n", "3 chien Bob" ] } ], "prompt_number": 25 }, { "cell_type": "code", "collapsed": false, "input": [ "a[a.espece.isin(['homme', 'chat'])]" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
especequi
0 homme Jean
1 chat Garfield
\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 26, "text": [ " espece qui\n", "0 homme Jean\n", "1 chat Garfield" ] } ], "prompt_number": 26 }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Jointures\n", "\n", "Une jointure est la fusion de deux tableaux le long d'une colonne" ] }, { "cell_type": "code", "collapsed": false, "input": [ "b = pd.DataFrame({\n", " 'espece' : ['chien', 'chat', 'homme', 'homme', 'homme'],\n", " 'sons' : ['abboie', 'miaule', 'parle', 'crie', 'hurle']\n", "})\n", "b" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
especesons
0 chien abboie
1 chat miaule
2 homme parle
3 homme crie
4 homme hurle
\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 27, "text": [ " espece sons\n", "0 chien abboie\n", "1 chat miaule\n", "2 homme parle\n", "3 homme crie\n", "4 homme hurle" ] } ], "prompt_number": 27 }, { "cell_type": "code", "collapsed": false, "input": [ "a.merge(b)" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
especequisons
0 homme Jean parle
1 homme Jean crie
2 homme Jean hurle
3 chat Garfield miaule
4 chien Milou abboie
5 chien Bob abboie
\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 28, "text": [ " espece qui sons\n", "0 homme Jean parle\n", "1 homme Jean crie\n", "2 homme Jean hurle\n", "3 chat Garfield miaule\n", "4 chien Milou abboie\n", "5 chien Bob abboie" ] } ], "prompt_number": 28 }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Regrouper" ] }, { "cell_type": "code", "collapsed": false, "input": [ "import urllib2, json\n", "prenoms = urllib2.urlopen('http://opendata.paris.fr/api/records/1.0/download?dataset=liste_des_prenoms_2004_a_2012&format=json')\n", "donnees_brutes = json.load(prenoms)\n", "donnees_brutes[0]" ], "language": "python", "metadata": {}, "outputs": [ { "metadata": {}, "output_type": "pyout", "prompt_number": 29, "text": [ "{u'datasetid': u'liste_des_prenoms_2004_a_2012',\n", " u'fields': {u'annee': 2011,\n", " u'nombre': 12,\n", " u'prenoms': u'Zachary',\n", " u'sexe': u'M'},\n", " u'record_timestamp': u'2015-03-16T17:33:33.316694',\n", " u'recordid': u'aa8805d011cdcc1b9cf1abcd8febd8946028050b'}" ] } ], "prompt_number": 29 }, { "cell_type": "code", "collapsed": false, "input": [ "p = pd.DataFrame([d['fields'] for d in donnees_brutes])\n", "p" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
anneenombreprenomssexe
0 2011 12 Zachary M
1 2011 5 Zakary M
2 2011 6 Zephyr M
3 2011 141 Zoe F
4 2011 6 A\u00c3\u00afsha F
5 2011 16 A\u00c3\u00afssatou F
6 2011 10 Cha\u00c3\u00afma F
7 2011 9 Ily\u00c3\u00a8s M
8 2011 13 Na\u00c3\u00ablle F
9 2011 8 Le\u00c3\u00afna F
10 2011 6 Micha\u00c3\u00abl M
11 2011 6 Sel\u00c3\u00a8ne F
12 2011 5 Sha\u00c3\u00afma F
13 2011 27 Tha\u00c3\u00afs F
14 2011 23 Ang\u00c3\u00a8le F
15 2011 9 Athena\u00c3\u00afs F
16 2011 203 In\u00c3\u00a8s F
17 2011 25 Ma\u00c3\u00afssa F
18 2011 20 Hel\u00c3\u00a8ne F
19 2011 10 Na\u00c3\u00afla F
20 2011 6 Na\u00c3\u00afl M
21 2012 6 A\u00c3\u00afdan M
22 2012 5 Anna\u00c3\u00ablle F
23 2012 11 Ga\u00c3\u00afa F
24 2012 36 Ka\u00c3\u00afs M
25 2012 5 Ma\u00c3\u00af F
26 2012 11 Aaliyah F
27 2012 14 Abdoulaye M
28 2012 7 Abigail F
29 2012 5 Abiga\u00c3\u00afl F
...............
13516 2014 5 Brayan M
13517 2014 5 Ezio M
13518 2014 5 Yohann M
13519 2014 5 Demba M
13520 2014 5 \u00c9liott M
13521 2014 5 Daouda M
13522 2014 5 Barnab\u00e9 M
13523 2014 5 Yaron M
13524 2014 5 Fallou M
13525 2014 5 Emir M
13526 2014 5 Aharon M
13527 2014 5 Salem M
13528 2014 5 Taha M
13529 2014 5 Iliane M
13530 2014 5 Mattia M
13531 2014 5 Giulio M
13532 2014 5 Giovanni M
13533 2014 5 Justin M
13534 2014 5 Gautier M
13535 2014 5 \u00c9than M
13537 2014 5 Khaled M
13538 2014 5 Malone M
13539 2014 5 Francesco M
13540 2014 5 Fr\u00e9d\u00e9ric M
13541 2014 5 Zayd M
13542 2014 5 Lirone M
13543 2014 5 Islem M
13544 2014 5 Kenzi M
13545 2014 5 Tim M
\n", "

13546 rows \u00d7 4 columns

\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 30, "text": [ " annee nombre prenoms sexe\n", "0 2011 12 Zachary M\n", "1 2011 5 Zakary M\n", "2 2011 6 Zephyr M\n", "3 2011 141 Zoe F\n", "4 2011 6 A\u00c3\u00afsha F\n", "5 2011 16 A\u00c3\u00afssatou F\n", "6 2011 10 Cha\u00c3\u00afma F\n", "7 2011 9 Ily\u00c3\u00a8s M\n", "8 2011 13 Na\u00c3\u00ablle F\n", "9 2011 8 Le\u00c3\u00afna F\n", "10 2011 6 Micha\u00c3\u00abl M\n", "11 2011 6 Sel\u00c3\u00a8ne F\n", "12 2011 5 Sha\u00c3\u00afma F\n", "13 2011 27 Tha\u00c3\u00afs F\n", "14 2011 23 Ang\u00c3\u00a8le F\n", "15 2011 9 Athena\u00c3\u00afs F\n", "16 2011 203 In\u00c3\u00a8s F\n", "17 2011 25 Ma\u00c3\u00afssa F\n", "18 2011 20 Hel\u00c3\u00a8ne F\n", "19 2011 10 Na\u00c3\u00afla F\n", "20 2011 6 Na\u00c3\u00afl M\n", "21 2012 6 A\u00c3\u00afdan M\n", "22 2012 5 Anna\u00c3\u00ablle F\n", "23 2012 11 Ga\u00c3\u00afa F\n", "24 2012 36 Ka\u00c3\u00afs M\n", "25 2012 5 Ma\u00c3\u00af F\n", "26 2012 11 Aaliyah F\n", "27 2012 14 Abdoulaye M\n", "28 2012 7 Abigail F\n", "29 2012 5 Abiga\u00c3\u00afl F\n", "... ... ... ... ...\n", "13516 2014 5 Brayan M\n", "13517 2014 5 Ezio M\n", "13518 2014 5 Yohann M\n", "13519 2014 5 Demba M\n", "13520 2014 5 \u00c9liott M\n", "13521 2014 5 Daouda M\n", "13522 2014 5 Barnab\u00e9 M\n", "13523 2014 5 Yaron M\n", "13524 2014 5 Fallou M\n", "13525 2014 5 Emir M\n", "13526 2014 5 Aharon M\n", "13527 2014 5 Salem M\n", "13528 2014 5 Taha M\n", "13529 2014 5 Iliane M\n", "13530 2014 5 Mattia M\n", "13531 2014 5 Giulio M\n", "13532 2014 5 Giovanni M\n", "13533 2014 5 Justin M\n", "13534 2014 5 Gautier M\n", "13535 2014 5 \u00c9than M\n", "13536 2014 5 Kader M\n", "13537 2014 5 Khaled M\n", "13538 2014 5 Malone M\n", "13539 2014 5 Francesco M\n", "13540 2014 5 Fr\u00e9d\u00e9ric M\n", "13541 2014 5 Zayd M\n", "13542 2014 5 Lirone M\n", "13543 2014 5 Islem M\n", "13544 2014 5 Kenzi M\n", "13545 2014 5 Tim M\n", "\n", "[13546 rows x 4 columns]" ] } ], "prompt_number": 30 }, { "cell_type": "code", "collapsed": false, "input": [ "p.groupby(p.annee).max()" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
anneenombreprenomssexe
annee
2004 2004 319 Zoe X
2005 2005 329 Zoe X
2006 2006 314 Zoe X
2007 2007 313 Zoe X
2008 2008 316 Zoe X
2009 2009 350 Zuzanna X
2010 2010 398 Zo\u00eb X
2011 2011 374 Zoe M
2012 2012 370 Zohra M
2013 2013 381 \u00c9va M
2014 2014 370 \u00c9va M
\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 31, "text": [ " annee nombre prenoms sexe\n", "annee \n", "2004 2004 319 Zoe X\n", "2005 2005 329 Zoe X\n", "2006 2006 314 Zoe X\n", "2007 2007 313 Zoe X\n", "2008 2008 316 Zoe X\n", "2009 2009 350 Zuzanna X\n", "2010 2010 398 Zo\u00eb X\n", "2011 2011 374 Zoe M\n", "2012 2012 370 Zohra M\n", "2013 2013 381 \u00c9va M\n", "2014 2014 370 \u00c9va M" ] } ], "prompt_number": 31 }, { "cell_type": "code", "collapsed": false, "input": [ "x = p.groupby(p.annee).sum()\n", "x" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
anneenombre
annee
2004 2186364 32645
2005 2215525 32231
2006 2324954 33128
2007 2259882 32098
2008 2277072 32855
2009 2422854 33949
2010 2442150 34130
2011 2783224 33952
2012 2794668 33120
2013 2870538 34702
2014 2640354 31671
\n", "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
nombre
anneesexe
2004F 15683
M 16948
X 14
2005F 15754
M 16457
X 20
2006F 16103
M 16969
X 56
2007F 15466
M 16611
X 21
2008F 16172
M 16655
X 28
2009F 16678
M 17231
X 40
2010F 16627
M 17461
X 42
2011F 16603
M 17349
2012F 16070
M 17050
2013F 17362
M 17340
2014F 15068
M 16603
\n", "
" ], "metadata": {}, "output_type": "pyout", "prompt_number": 34, "text": [ " nombre\n", "annee sexe \n", "2004 F 15683\n", " M 16948\n", " X 14\n", "2005 F 15754\n", " M 16457\n", " X 20\n", "2006 F 16103\n", " M 16969\n", " X 56\n", "2007 F 15466\n", " M 16611\n", " X 21\n", "2008 F 16172\n", " M 16655\n", " X 28\n", "2009 F 16678\n", " M 17231\n", " X 40\n", "2010 F 16627\n", " M 17461\n", " X 42\n", "2011 F 16603\n", " M 17349\n", "2012 F 16070\n", " M 17050\n", "2013 F 17362\n", " M 17340\n", "2014 F 15068\n", " M 16603" ] } ], "prompt_number": 34 }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Pivoter" ] }, { "cell_type": "code", "collapsed": false, "input": [ "p.pivot_table(values='nombre', columns='annee', index='prenoms').sort(2014, ascending=False)" ], "language": "python", "metadata": {}, "outputs": [ { "html": [ "
\n", "\n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", " \n", "
annee20042005200620072008200920102011201220132014
prenoms
Gabriel 252 239 285 313.0 316 350 398.0 374.0 370 381 370
Adam 169 187 218 243.0 271 279 295.0 287.0 340 330 344
Rapha\u00ebl 280 269 314 303.0 280 299 298.0 300.0 251 NaN 316
Louise 206 195 218 265.0 288 322 335.0 306.0 306 347 310
Louis 237 207 247 256.0 254 257 272.0 242.0 277 277 301
Paul 294 248 243 257.0 242 274 252.0 245.0 242 222 269
Arthur 203 261 225 241.0 267 258 302.0 306.0 299 271 255
Chlo\u00e9 NaN NaN NaN NaN NaN NaN NaN NaN NaN 236 216
In\u00e8s 268 282 255 199.0 227 216 207.0 203.0 201 201 211
Alice 193 193 153 190.0 136 202 213.0 203.0 197 229 210
Victor 226 173 184 181.0 207 207 219.0 191.0 204 218 208
Jeanne 156 179 159 192.0 175 172 192.0 197.0 163 183 201
Mohamed 150 155 155 130.0 144 169 156.0 187.0 163 211 199
Alexandre 319 329 309 298.0 260 286 267.0 243.0 217 220 198
Sarah 204 221 232 214.0 241 225 246.0 198.0 189 201 176
Lucas 189 197 168 214.0 192 221 186.0 191.0 175 166 173
Jules 187 209 161 216.0 190 199 168.0 163.0 162 165 172
Hugo 210 161 157 158.0 135 161 148.0 142.0 165 196 170
Joseph 78 75 93 84.0 89 126 120.0 125.0 120 150 163
Lina 91 94 114 125.0 136 144 169.0 154.0 142 153 162
Emma 265 274 282 246.0 255 239 250.0 216.0 177 168 161
Ad\u00e8le 67 88 97 80.0 78 85 100.0 98.0 133 103 154
Rose 51 74 68 85.0 91 125 103.0 109.0 108 111 145
Juliette 170 137 149 154.0 166 175 165.0 180.0 163 139 145
Eva 139 69 83 87.5 82 87 102.5 84.5 65 94 145
Anna 117 141 116 119.0 127 130 161.0 132.0 146 128 144
Gaspard 100 119 112 135.0 145 122 127.0 129.0 170 173 139
Martin 118 106 107 105.0 150 111 123.0 113.0 99 94 136
L\u00e9a NaN NaN NaN NaN NaN NaN NaN NaN NaN 131 133
Jade 139 130 119 129.0 136 148 142.0 135.0 126 100 133
....................................
Zelie 13 11 10 14.0 25 33 24.0 30.0 32 NaN NaN
Zephyr NaN NaN NaN NaN NaN NaN NaN 6.0 NaN NaN NaN
Zeynab NaN NaN NaN NaN NaN NaN NaN NaN NaN 7 NaN
Ziad NaN NaN NaN NaN NaN NaN NaN NaN 5 NaN NaN
Zina NaN NaN NaN 6.0 NaN NaN NaN NaN NaN NaN NaN
Zinedine NaN NaN NaN NaN NaN NaN NaN NaN NaN 6 NaN
Zoe 109 100 117 137.0 141 154 113.0 141.0 112 NaN NaN
Zo\u00c3\u00a9 NaN NaN NaN NaN NaN NaN NaN NaN NaN 104 NaN
Zo\u00c3\u00ab NaN NaN NaN NaN NaN 6 6.0 NaN NaN NaN NaN
Zo\u00eb NaN NaN NaN NaN NaN 6 6.0 NaN NaN NaN NaN
Zuzanna NaN NaN NaN NaN NaN 6 NaN NaN NaN NaN NaN
Zyad NaN NaN NaN NaN NaN NaN NaN NaN NaN 5 NaN
Z\u00c3\u00a9lie NaN NaN NaN NaN NaN NaN NaN NaN NaN 24 NaN
\u00c3\u0088ve NaN NaN NaN NaN NaN NaN NaN NaN NaN 7 NaN
\u00c3\u0089douard NaN NaN NaN NaN NaN NaN NaN NaN NaN 6 NaN
\u00c3\u0089lias NaN NaN NaN NaN NaN NaN NaN NaN NaN 6 NaN
\u00c3\u0089lie NaN NaN NaN NaN NaN NaN NaN NaN NaN 9 NaN
\u00c3\u0089line NaN NaN NaN NaN NaN NaN NaN NaN NaN 7 NaN
\u00c3\u0089lisa NaN NaN NaN NaN NaN NaN NaN NaN NaN 13 NaN
\u00c3\u0089lise NaN NaN NaN NaN NaN NaN NaN NaN NaN 15 NaN
\u00c3\u0089lo\u00c3\u00afse NaN NaN NaN NaN NaN NaN NaN NaN NaN 8 NaN
\u00c3\u0089l\u00c3\u00a9na NaN NaN NaN NaN NaN NaN NaN NaN NaN 7 NaN
\u00c3\u0089l\u00c3\u00a9onore NaN NaN NaN NaN NaN NaN NaN NaN NaN 31 NaN
\u00c3\u0089mile NaN NaN NaN NaN NaN NaN NaN NaN NaN 10 NaN
\u00c3\u0089milie NaN NaN NaN NaN NaN NaN NaN NaN NaN 17 NaN
\u00c3\u0089nora NaN NaN NaN NaN NaN NaN NaN NaN NaN 8 NaN
\u00c3\u0089tienne NaN NaN NaN NaN NaN NaN NaN NaN NaN 5 NaN
\u00c3\u0089va NaN NaN NaN NaN NaN NaN NaN NaN NaN 9 NaN
\u00c9l\u00e9na NaN NaN NaN NaN NaN NaN NaN NaN NaN 7 NaN
\u00c9tienne NaN NaN NaN NaN NaN NaN NaN NaN NaN 5 NaN
\n", "

2415 rows \u00d7 11 columns

\n", "