Skip to content

Instantly share code, notes, and snippets.

@robroc
Created August 4, 2014 20:28
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 robroc/c13b273c7b15899b2176 to your computer and use it in GitHub Desktop.
Save robroc/c13b273c7b15899b2176 to your computer and use it in GitHub Desktop.
Mining Montreal's library calaogue
{
"metadata": {
"name": "",
"signature": "sha256:edbadb450210414c6ea44c2940914fd552299a2ed5624b1c1a1d7acf253e8144"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
"cell_type": "code",
"collapsed": false,
"input": [
"import pandas as pd\n",
"import numpy as np"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 1
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Import data file as a pandas data frame"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"heads = [\"borough\",\"location\",\"creation_date\",\"total_loans\",\"year_loans\",\"status\",\"type\",\"cote\",\"title\",\"variant\",\"author\",\"collaboration\",\"publisher\",\"place\",\"country\",\"year\",\"num_pages\",\"language\",\"collection\",\"ISBN\",\"img_url\"]\n",
"data = pd.read_csv('donnees_ouverte.csv', encoding='utf-8', header=None, names=heads)"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 49
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"data[:4]"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>borough</th>\n",
" <th>location</th>\n",
" <th>creation_date</th>\n",
" <th>total_loans</th>\n",
" <th>year_loans</th>\n",
" <th>status</th>\n",
" <th>type</th>\n",
" <th>cote</th>\n",
" <th>title</th>\n",
" <th>variant</th>\n",
" <th>author</th>\n",
" <th>collaboration</th>\n",
" <th>publisher</th>\n",
" <th>place</th>\n",
" <th>country</th>\n",
" <th>year</th>\n",
" <th>num_pages</th>\n",
" <th>language</th>\n",
" <th>collection</th>\n",
" <th>ISBN</th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td> Anjou</td>\n",
" <td> (ANJ) Jean-Corbeil / Adultes - Romans</td>\n",
" <td> 2008-03-09 01:21:52</td>\n",
" <td> 2</td>\n",
" <td> 1</td>\n",
" <td> Disponible</td>\n",
" <td> LV_Fiction A</td>\n",
" <td> C823.99 B249abL</td>\n",
" <td> Abra :</td>\n",
" <td> NaN</td>\n",
" <td> Barfoot, Joan,</td>\n",
" <td> NaN</td>\n",
" <td> Qu\u00c3\u00a9bec-Am\u00c3\u00a9rique,</td>\n",
" <td> Montr\u00c3\u00a9al :</td>\n",
" <td> quc</td>\n",
" <td> c1985.</td>\n",
" <td> 269 p. ;</td>\n",
" <td> fre</td>\n",
" <td> NaN</td>\n",
" <td> 2890372588 (br.)</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td> Saint-L\u00c3\u00a9onard</td>\n",
" <td> (SLE) Saint-L\u00c3\u00a9onard / Adultes - Romans</td>\n",
" <td> 2010-11-25 22:41:02</td>\n",
" <td> 0</td>\n",
" <td> 0</td>\n",
" <td> Disponible</td>\n",
" <td> LV_Fiction A</td>\n",
" <td> C823.99 B249abL</td>\n",
" <td> Abra :</td>\n",
" <td> NaN</td>\n",
" <td> Barfoot, Joan,</td>\n",
" <td> NaN</td>\n",
" <td> Qu\u00c3\u00a9bec-Am\u00c3\u00a9rique,</td>\n",
" <td> Montr\u00c3\u00a9al :</td>\n",
" <td> quc</td>\n",
" <td> c1985.</td>\n",
" <td> 269 p. ;</td>\n",
" <td> fre</td>\n",
" <td> NaN</td>\n",
" <td> 2890372588 (br.)</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td> Sans Arroundissement</td>\n",
" <td> Biblio-Courrier / Adultes - Romans</td>\n",
" <td> 2007-06-08 00:13:41</td>\n",
" <td> 0</td>\n",
" <td> 0</td>\n",
" <td> Disponible</td>\n",
" <td> LV_Fiction A</td>\n",
" <td> C823.99 B249abL</td>\n",
" <td> Abra :</td>\n",
" <td> NaN</td>\n",
" <td> Barfoot, Joan,</td>\n",
" <td> NaN</td>\n",
" <td> Qu\u00c3\u00a9bec-Am\u00c3\u00a9rique,</td>\n",
" <td> Montr\u00c3\u00a9al :</td>\n",
" <td> quc</td>\n",
" <td> c1985.</td>\n",
" <td> 269 p. ;</td>\n",
" <td> fre</td>\n",
" <td> NaN</td>\n",
" <td> 2890372588 (br.)</td>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td> C\u00c3\u00b4te-des-Neiges - Notre-Dame-de-Gr\u00c3\u00a2ce</td>\n",
" <td> (CND) C-D-Neiges / Jeunes - BD</td>\n",
" <td> 2007-06-08 00:13:41</td>\n",
" <td> 6</td>\n",
" <td> 0</td>\n",
" <td> Disponible</td>\n",
" <td> LV_Fiction J</td>\n",
" <td> NaN</td>\n",
" <td> L'invincible Armada /</td>\n",
" <td> NaN</td>\n",
" <td> De Moor, Bob,</td>\n",
" <td> NaN</td>\n",
" <td> Casterman,</td>\n",
" <td> Tournai :</td>\n",
" <td> be </td>\n",
" <td> 1978- .</td>\n",
" <td> v. :</td>\n",
" <td> fre</td>\n",
" <td> NaN</td>\n",
" <td> 2203320036 (v.2 : cart.) </td>\n",
" <td>...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>4 rows \u00d7 21 columns</p>\n",
"</div>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 4,
"text": [
" borough \\\n",
"0 Anjou \n",
"1 Saint-L\u00c3\u00a9onard \n",
"2 Sans Arroundissement \n",
"3 C\u00c3\u00b4te-des-Neiges - Notre-Dame-de-Gr\u00c3\u00a2ce \n",
"\n",
" location creation_date total_loans \\\n",
"0 (ANJ) Jean-Corbeil / Adultes - Romans 2008-03-09 01:21:52 2 \n",
"1 (SLE) Saint-L\u00c3\u00a9onard / Adultes - Romans 2010-11-25 22:41:02 0 \n",
"2 Biblio-Courrier / Adultes - Romans 2007-06-08 00:13:41 0 \n",
"3 (CND) C-D-Neiges / Jeunes - BD 2007-06-08 00:13:41 6 \n",
"\n",
" year_loans status type cote \\\n",
"0 1 Disponible LV_Fiction A C823.99 B249abL \n",
"1 0 Disponible LV_Fiction A C823.99 B249abL \n",
"2 0 Disponible LV_Fiction A C823.99 B249abL \n",
"3 0 Disponible LV_Fiction J NaN \n",
"\n",
" title variant author collaboration \\\n",
"0 Abra : NaN Barfoot, Joan, NaN \n",
"1 Abra : NaN Barfoot, Joan, NaN \n",
"2 Abra : NaN Barfoot, Joan, NaN \n",
"3 L'invincible Armada / NaN De Moor, Bob, NaN \n",
"\n",
" publisher place country year num_pages language \\\n",
"0 Qu\u00c3\u00a9bec-Am\u00c3\u00a9rique, Montr\u00c3\u00a9al : quc c1985. 269 p. ; fre \n",
"1 Qu\u00c3\u00a9bec-Am\u00c3\u00a9rique, Montr\u00c3\u00a9al : quc c1985. 269 p. ; fre \n",
"2 Qu\u00c3\u00a9bec-Am\u00c3\u00a9rique, Montr\u00c3\u00a9al : quc c1985. 269 p. ; fre \n",
"3 Casterman, Tournai : be 1978- . v. : fre \n",
"\n",
" collection ISBN \n",
"0 NaN 2890372588 (br.) ... \n",
"1 NaN 2890372588 (br.) ... \n",
"2 NaN 2890372588 (br.) ... \n",
"3 NaN 2203320036 (v.2 : cart.) ... \n",
"\n",
"[4 rows x 21 columns]"
]
}
],
"prompt_number": 4
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"How many of each genre in the catalog?"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"type_counts = data.groupby(['type'])\n",
"type_counts.aggregate(np.sum).sort('total_loans', ascending=False)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>total_loans</th>\n",
" <th>year_loans</th>\n",
" </tr>\n",
" <tr>\n",
" <th>type</th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>LV_Fiction J</th>\n",
" <td> 11131095</td>\n",
" <td> 1241880</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LV_Fiction A</th>\n",
" <td> 8120716</td>\n",
" <td> 1143277</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LV_Documentaire A</th>\n",
" <td> 4900688</td>\n",
" <td> 847388</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DVD A</th>\n",
" <td> 4805153</td>\n",
" <td> 324077</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LV_Documentaire J</th>\n",
" <td> 3007874</td>\n",
" <td> 472282</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DVD J</th>\n",
" <td> 1923453</td>\n",
" <td> 151487</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DC_Musique A</th>\n",
" <td> 1306841</td>\n",
" <td> 174419</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Nouveaut\u00c3\u00a9</th>\n",
" <td> 498511</td>\n",
" <td> 140704</td>\n",
" </tr>\n",
" <tr>\n",
" <th>PER_Imprim\u00c3\u00a9 A</th>\n",
" <td> 440278</td>\n",
" <td> 189779</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LV_Gros caract\u00c3\u00a8res A</th>\n",
" <td> 211599</td>\n",
" <td> 32831</td>\n",
" </tr>\n",
" <tr>\n",
" <th>PER_Imprim\u00c3\u00a9 J</th>\n",
" <td> 170694</td>\n",
" <td> 54370</td>\n",
" </tr>\n",
" <tr>\n",
" <th>MULTI-SUPPORTS J</th>\n",
" <td> 166776</td>\n",
" <td> 18774</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DC_Livre sonore A</th>\n",
" <td> 137497</td>\n",
" <td> 20550</td>\n",
" </tr>\n",
" <tr>\n",
" <th>JEU VIDEO SUR CONSOLE J</th>\n",
" <td> 91803</td>\n",
" <td> 17003</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DVD BLU-RAY A</th>\n",
" <td> 83691</td>\n",
" <td> 17790</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DC_Musique J</th>\n",
" <td> 78583</td>\n",
" <td> 9491</td>\n",
" </tr>\n",
" <tr>\n",
" <th>JEU \u00c3\u0089DUCATIF J</th>\n",
" <td> 56056</td>\n",
" <td> 7599</td>\n",
" </tr>\n",
" <tr>\n",
" <th>CD-ROM J</th>\n",
" <td> 52507</td>\n",
" <td> 4454</td>\n",
" </tr>\n",
" <tr>\n",
" <th>MULTI-S_Langues A</th>\n",
" <td> 42718</td>\n",
" <td> 3613</td>\n",
" </tr>\n",
" <tr>\n",
" <th>MULTI-SUPPORTS A</th>\n",
" <td> 37506</td>\n",
" <td> 4657</td>\n",
" </tr>\n",
" <tr>\n",
" <th>JEU VIDEO SUR CONSOLE A</th>\n",
" <td> 35324</td>\n",
" <td> 8668</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DVD BLU-RAY J</th>\n",
" <td> 27094</td>\n",
" <td> 4211</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DC_Langues A</th>\n",
" <td> 26150</td>\n",
" <td> 2794</td>\n",
" </tr>\n",
" <tr>\n",
" <th>CD-ROM A</th>\n",
" <td> 24590</td>\n",
" <td> 2346</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DC_Livre sonore J</th>\n",
" <td> 23759</td>\n",
" <td> 3619</td>\n",
" </tr>\n",
" <tr>\n",
" <th>CD-ROM_Langues A</th>\n",
" <td> 19131</td>\n",
" <td> 1520</td>\n",
" </tr>\n",
" <tr>\n",
" <th>PARTITION A</th>\n",
" <td> 16021</td>\n",
" <td> 2709</td>\n",
" </tr>\n",
" <tr>\n",
" <th>PO_Qu\u00c3\u00a9bec</th>\n",
" <td> 15411</td>\n",
" <td> 1487</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DOC. CARTOGR.</th>\n",
" <td> 9527</td>\n",
" <td> 1348</td>\n",
" </tr>\n",
" <tr>\n",
" <th>MULTI-S_Langues J</th>\n",
" <td> 9257</td>\n",
" <td> 1015</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LV_Location</th>\n",
" <td> 5932</td>\n",
" <td> 2325</td>\n",
" </tr>\n",
" <tr>\n",
" <th>CD-ROM_Langues J</th>\n",
" <td> 4355</td>\n",
" <td> 377</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DC_Langues J</th>\n",
" <td> 2251</td>\n",
" <td> 282</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LV_R\u00c3\u00a9f\u00c3\u00a9rence A</th>\n",
" <td> 2023</td>\n",
" <td> 559</td>\n",
" </tr>\n",
" <tr>\n",
" <th>VIDEOCAS A</th>\n",
" <td> 2008</td>\n",
" <td> 565</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LV_R\u00c3\u00a9f\u00c3\u00a9rence J</th>\n",
" <td> 1806</td>\n",
" <td> 489</td>\n",
" </tr>\n",
" <tr>\n",
" <th>VIDEOCAS J</th>\n",
" <td> 1785</td>\n",
" <td> 229</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DVD_Langues A</th>\n",
" <td> 1214</td>\n",
" <td> 121</td>\n",
" </tr>\n",
" <tr>\n",
" <th>CAS_Livre sonore A</th>\n",
" <td> 1174</td>\n",
" <td> 281</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LV_Livre num\u00c3\u00a9rique A</th>\n",
" <td> 768</td>\n",
" <td> 134</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DVD-ROM A</th>\n",
" <td> 552</td>\n",
" <td> 81</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DVD-ROM J</th>\n",
" <td> 440</td>\n",
" <td> 59</td>\n",
" </tr>\n",
" <tr>\n",
" <th>PO_Autres</th>\n",
" <td> 359</td>\n",
" <td> 44</td>\n",
" </tr>\n",
" <tr>\n",
" <th>PO_Canada</th>\n",
" <td> 356</td>\n",
" <td> 83</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LV_Gros caract\u00c3\u00a8res J</th>\n",
" <td> 339</td>\n",
" <td> 37</td>\n",
" </tr>\n",
" <tr>\n",
" <th>VIDEOCAS_Langues A</th>\n",
" <td> 316</td>\n",
" <td> 30</td>\n",
" </tr>\n",
" <tr>\n",
" <th>CAS_Musique A</th>\n",
" <td> 274</td>\n",
" <td> 31</td>\n",
" </tr>\n",
" <tr>\n",
" <th>CAS_Livre sonore J</th>\n",
" <td> 255</td>\n",
" <td> 37</td>\n",
" </tr>\n",
" <tr>\n",
" <th>CAS_Langues A</th>\n",
" <td> 206</td>\n",
" <td> 16</td>\n",
" </tr>\n",
" <tr>\n",
" <th>AFFICHE/POSTER</th>\n",
" <td> 201</td>\n",
" <td> 34</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LV_Braille</th>\n",
" <td> 195</td>\n",
" <td> 36</td>\n",
" </tr>\n",
" <tr>\n",
" <th>PARTITION J</th>\n",
" <td> 138</td>\n",
" <td> 26</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Non trait\u00c3\u00a9</th>\n",
" <td> 102</td>\n",
" <td> 14</td>\n",
" </tr>\n",
" <tr>\n",
" <th>201</th>\n",
" <td> 42</td>\n",
" <td> 20</td>\n",
" </tr>\n",
" <tr>\n",
" <th>CAS_Musique J</th>\n",
" <td> 40</td>\n",
" <td> 7</td>\n",
" </tr>\n",
" <tr>\n",
" <th>DOSSIER J</th>\n",
" <td> 15</td>\n",
" <td> 2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>303.49 W746L</th>\n",
" <td> 8</td>\n",
" <td> 0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>JEU \u00c3\u0089DUCATIF A</th>\n",
" <td> 3</td>\n",
" <td> 2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>CAS_Langues J</th>\n",
" <td> 3</td>\n",
" <td> 0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>VIDEOCAS_Langues J</th>\n",
" <td> 3</td>\n",
" <td> 0</td>\n",
" </tr>\n",
" <tr>\n",
" <th></th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>71 rows \u00d7 2 columns</p>\n",
"</div>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 84,
"text": [
" total_loans year_loans\n",
"type \n",
"LV_Fiction J 11131095 1241880\n",
"LV_Fiction A 8120716 1143277\n",
"LV_Documentaire A 4900688 847388\n",
"DVD A 4805153 324077\n",
"LV_Documentaire J 3007874 472282\n",
"DVD J 1923453 151487\n",
"DC_Musique A 1306841 174419\n",
"Nouveaut\u00c3\u00a9 498511 140704\n",
"PER_Imprim\u00c3\u00a9 A 440278 189779\n",
"LV_Gros caract\u00c3\u00a8res A 211599 32831\n",
"PER_Imprim\u00c3\u00a9 J 170694 54370\n",
"MULTI-SUPPORTS J 166776 18774\n",
"DC_Livre sonore A 137497 20550\n",
"JEU VIDEO SUR CONSOLE J 91803 17003\n",
"DVD BLU-RAY A 83691 17790\n",
"DC_Musique J 78583 9491\n",
"JEU \u00c3\u0089DUCATIF J 56056 7599\n",
"CD-ROM J 52507 4454\n",
"MULTI-S_Langues A 42718 3613\n",
"MULTI-SUPPORTS A 37506 4657\n",
"JEU VIDEO SUR CONSOLE A 35324 8668\n",
"DVD BLU-RAY J 27094 4211\n",
"DC_Langues A 26150 2794\n",
"CD-ROM A 24590 2346\n",
"DC_Livre sonore J 23759 3619\n",
"CD-ROM_Langues A 19131 1520\n",
"PARTITION A 16021 2709\n",
"PO_Qu\u00c3\u00a9bec 15411 1487\n",
"DOC. CARTOGR. 9527 1348\n",
"MULTI-S_Langues J 9257 1015\n",
"LV_Location 5932 2325\n",
"CD-ROM_Langues J 4355 377\n",
"DC_Langues J 2251 282\n",
"LV_R\u00c3\u00a9f\u00c3\u00a9rence A 2023 559\n",
"VIDEOCAS A 2008 565\n",
"LV_R\u00c3\u00a9f\u00c3\u00a9rence J 1806 489\n",
"VIDEOCAS J 1785 229\n",
"DVD_Langues A 1214 121\n",
"CAS_Livre sonore A 1174 281\n",
"LV_Livre num\u00c3\u00a9rique A 768 134\n",
"DVD-ROM A 552 81\n",
"DVD-ROM J 440 59\n",
"PO_Autres 359 44\n",
"PO_Canada 356 83\n",
"LV_Gros caract\u00c3\u00a8res J 339 37\n",
"VIDEOCAS_Langues A 316 30\n",
"CAS_Musique A 274 31\n",
"CAS_Livre sonore J 255 37\n",
"CAS_Langues A 206 16\n",
"AFFICHE/POSTER 201 34\n",
"LV_Braille 195 36\n",
"PARTITION J 138 26\n",
"Non trait\u00c3\u00a9 102 14\n",
"201 42 20\n",
"CAS_Musique J 40 7\n",
"DOSSIER J 15 2\n",
"303.49 W746L 8 0\n",
"JEU \u00c3\u0089DUCATIF A 3 2\n",
"CAS_Langues J 3 0\n",
"VIDEOCAS_Langues J 3 0\n",
" ... ...\n",
"\n",
"[71 rows x 2 columns]"
]
}
],
"prompt_number": 84
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Number of unique titles (out of 4.4 total)"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"len(data['title'].unique())"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 5,
"text": [
"735657"
]
}
],
"prompt_number": 5
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Which boroughs have the largest collections?"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"data['borough'].value_counts()"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 12,
"text": [
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce 403759\n",
"Saint-Laurent 322519\n",
"Rosemont - La Petite-Patrie 299252\n",
"Villeray - Saint-Michel - Parc-Extension 292581\n",
"Mercier-Hochelaga-Maisonneuve 276324\n",
"Ahuntsic - Cartierville 267121\n",
"Pierrefonds - Roxboro 265956\n",
"Montr\u00e9al-Nord 258445\n",
"LaSalle 247478\n",
"Saint-L\u00e9onard 219786\n",
"Verdun 217866\n",
"Sud-Ouest 207937\n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles 206339\n",
"Plateau-Mont-Royal 165997\n",
"Ville-Marie 163627\n",
"Anjou 135930\n",
"Outremont 83444\n",
"Sans Arroundissement 79398\n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve 61766\n",
"Lachine 57553\n",
"dtype: int64"
]
}
],
"prompt_number": 12
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Find most popular titles overall"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"title_counts = data.groupby(['title'])\n",
"title_counts.aggregate(np.sum).sort('total_loans', ascending=False).head(10)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>total_loans</th>\n",
" <th>year_loans</th>\n",
" </tr>\n",
" <tr>\n",
" <th>title</th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Naruto.</th>\n",
" <td> 166289</td>\n",
" <td> 10443</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Album Garfield.</th>\n",
" <td> 97612</td>\n",
" <td> 5250</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Winx club.</th>\n",
" <td> 65142</td>\n",
" <td> 3697</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Les l\u00c3\u00a9gendaires.</th>\n",
" <td> 56372</td>\n",
" <td> 3710</td>\n",
" </tr>\n",
" <tr>\n",
" <th>D\u00c3\u00a9tective Conan.</th>\n",
" <td> 51235</td>\n",
" <td> 3899</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Les Simpson.</th>\n",
" <td> 49276</td>\n",
" <td> 3406</td>\n",
" </tr>\n",
" <tr>\n",
" <th>One Piece.</th>\n",
" <td> 47003</td>\n",
" <td> 3796</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Yu-Gi-Oh.</th>\n",
" <td> 40751</td>\n",
" <td> 2286</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Fruits basket, une corbeille de fruits.</th>\n",
" <td> 36220</td>\n",
" <td> 1906</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Caillou.</th>\n",
" <td> 35773</td>\n",
" <td> 2428</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>10 rows \u00d7 2 columns</p>\n",
"</div>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 112,
"text": [
" total_loans year_loans\n",
"title \n",
"Naruto. 166289 10443\n",
"Album Garfield. 97612 5250\n",
"Winx club. 65142 3697\n",
"Les l\u00c3\u00a9gendaires. 56372 3710\n",
"D\u00c3\u00a9tective Conan. 51235 3899\n",
"Les Simpson. 49276 3406\n",
"One Piece. 47003 3796\n",
"Yu-Gi-Oh. 40751 2286\n",
"Fruits basket, une corbeille de fruits. 36220 1906\n",
"Caillou. 35773 2428\n",
"\n",
"[10 rows x 2 columns]"
]
}
],
"prompt_number": 112
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Filtered data frame for English fiction"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"eng_fiction = data[(data.type == 'LV_Fiction A' ) & (data.language == 'eng')]"
],
"language": "python",
"metadata": {},
"outputs": [],
"prompt_number": 60
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Find the most loaned-out English book at a single library, because why not"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"eng_fiction.ix[eng_fiction['total_loans'].idxmax()]"
],
"language": "python",
"metadata": {},
"outputs": [
{
"metadata": {},
"output_type": "pyout",
"prompt_number": 56,
"text": [
"borough Ahuntsic - Cartierville\n",
"location (AHC) Ahuntsic / Adultes - Romans\n",
"creation_date 2008-11-27 10:46:00\n",
"total_loans 74\n",
"year_loans 5\n",
"status Disponible\n",
"type LV_Fiction A\n",
"cote NaN\n",
"title The brass verdict :\n",
"variant NaN\n",
"author Connelly, Michael,\n",
"collaboration NaN\n",
"publisher Little, Brown and Co.,\n",
"place New York :\n",
"country xxu\n",
"year 2008.\n",
"num_pages 422 p. ;\n",
"language eng\n",
"collection NaN\n",
"ISBN 0316166294 (hbk.)\n",
"img_url NaN\n",
"Name: 2415431, dtype: object"
]
}
],
"prompt_number": 56
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Find most loaned out English book "
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"eng_counts = eng_fiction.groupby(['title', 'variant'])\n",
"eng_counts.aggregate(np.sum).sort('total_loans', ascending=False)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th></th>\n",
" <th>total_loans</th>\n",
" <th>year_loans</th>\n",
" </tr>\n",
" <tr>\n",
" <th>title</th>\n",
" <th>variant</th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Millennium.</th>\n",
" <th>Girl with the dragon tattoo.</th>\n",
" <td> 1244</td>\n",
" <td> 68</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Nine dragons :</th>\n",
" <th>9 dragons</th>\n",
" <td> 998</td>\n",
" <td> 99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Fifty shades.</th>\n",
" <th>Fifty shades of Grey</th>\n",
" <td> 916</td>\n",
" <td> 107</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The lucky one :</th>\n",
" <th>Lucky 1.</th>\n",
" <td> 897</td>\n",
" <td> 64</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"2\" valign=\"top\">Millennium.</th>\n",
" <th>Girl who kicked the hornets' nest</th>\n",
" <td> 892</td>\n",
" <td> 81</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Girl who played with fire</th>\n",
" <td> 882</td>\n",
" <td> 55</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Twenties girl :</th>\n",
" <th>20's girl.</th>\n",
" <td> 822</td>\n",
" <td> 50</td>\n",
" </tr>\n",
" <tr>\n",
" <th>61 hours :</th>\n",
" <th>Sixty-one hours</th>\n",
" <td> 802</td>\n",
" <td> 107</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10th anniversary /</th>\n",
" <th>Tenth anniversary</th>\n",
" <td> 716</td>\n",
" <td> 74</td>\n",
" </tr>\n",
" <tr>\n",
" <th>I'll walk alone :</th>\n",
" <th>I will walk alone</th>\n",
" <td> 715</td>\n",
" <td> 109</td>\n",
" </tr>\n",
" <tr>\n",
" <th>206 bones :</th>\n",
" <th>Two hundred six bones.</th>\n",
" <td> 708</td>\n",
" <td> 60</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The fifth witness :</th>\n",
" <th>5th witness</th>\n",
" <td> 707</td>\n",
" <td> 68</td>\n",
" </tr>\n",
" <tr>\n",
" <th>One day at a time /</th>\n",
" <th>1 day at a time.</th>\n",
" <td> 698</td>\n",
" <td> 48</td>\n",
" </tr>\n",
" <tr>\n",
" <th>A thousand splendid suns :</th>\n",
" <th>A 1, 000 splendid suns.</th>\n",
" <td> 677</td>\n",
" <td> 36</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Fifty shades.</th>\n",
" <th>Fifty shades darker</th>\n",
" <td> 675</td>\n",
" <td> 73</td>\n",
" </tr>\n",
" <tr>\n",
" <th>44 Charles Street :</th>\n",
" <th>Forty-four Charles Street</th>\n",
" <td> 672</td>\n",
" <td> 87</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The Inn Boonsboro.</th>\n",
" <th>Next always</th>\n",
" <td> 645</td>\n",
" <td> 77</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Don't blink :</th>\n",
" <th>Do not blink</th>\n",
" <td> 632</td>\n",
" <td> 58</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The 6th target /</th>\n",
" <th>Sixth target</th>\n",
" <td> 632</td>\n",
" <td> 68</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Love the one you're with /</th>\n",
" <th>Love the one you are with</th>\n",
" <td> 603</td>\n",
" <td> 48</td>\n",
" </tr>\n",
" <tr>\n",
" <th>You've been warned :</th>\n",
" <th>You have been warned.</th>\n",
" <td> 589</td>\n",
" <td> 43</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The 8th confession /</th>\n",
" <th>Eighth confession.</th>\n",
" <td> 588</td>\n",
" <td> 62</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The sixth man /</th>\n",
" <th>6th man</th>\n",
" <td> 585</td>\n",
" <td> 62</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Fearless fourteen :</th>\n",
" <th>Fearless 14.</th>\n",
" <td> 580</td>\n",
" <td> 49</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The 9th judgment /</th>\n",
" <th>Ninth judgment</th>\n",
" <td> 579</td>\n",
" <td> 39</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Zero day :</th>\n",
" <th>0 day</th>\n",
" <td> 565</td>\n",
" <td> 63</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The Hunger Games.</th>\n",
" <th>Catching fire</th>\n",
" <td> 554</td>\n",
" <td> 43</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Fire and ice :</th>\n",
" <th>Fire &amp; ice.</th>\n",
" <td> 553</td>\n",
" <td> 49</td>\n",
" </tr>\n",
" <tr>\n",
" <th>I've got your number :</th>\n",
" <th>I have got your number</th>\n",
" <td> 548</td>\n",
" <td> 69</td>\n",
" </tr>\n",
" <tr>\n",
" <th>7th heaven /</th>\n",
" <th>Seventh heaven</th>\n",
" <td> 547</td>\n",
" <td> 52</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Beatrice &amp; Virgil :</th>\n",
" <th>Beatrice and Virgil</th>\n",
" <td> 543</td>\n",
" <td> 45</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Smokin' seventeen :</th>\n",
" <th>Smoking 17</th>\n",
" <td> 540</td>\n",
" <td> 61</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Fifty shades.</th>\n",
" <th>50 shades freed</th>\n",
" <td> 535</td>\n",
" <td> 52</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Finger lickin' fifteen :</th>\n",
" <th>Finger lickin' 15.</th>\n",
" <td> 533</td>\n",
" <td> 36</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Alex Cross's trial /</th>\n",
" <th>Trial.</th>\n",
" <td> 521</td>\n",
" <td> 44</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ice cold :</th>\n",
" <th>Rizzoli and Isles</th>\n",
" <td> 518</td>\n",
" <td> 43</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11/22/63 :</th>\n",
" <th>Eleven twenty-two sixty-three</th>\n",
" <td> 516</td>\n",
" <td> 94</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The Clifton chronicles.</th>\n",
" <th>Only time will tell</th>\n",
" <td> 508</td>\n",
" <td> 90</td>\n",
" </tr>\n",
" <tr>\n",
" <th>One summer /</th>\n",
" <th>1 summer</th>\n",
" <td> 493</td>\n",
" <td> 64</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The Inn Boonsboro.</th>\n",
" <th>Last boyfriend</th>\n",
" <td> 491</td>\n",
" <td> 85</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Code to zero /</th>\n",
" <th>Code to 0.</th>\n",
" <td> 478</td>\n",
" <td> 48</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Hunger Games.</th>\n",
" <th>Mockingjay</th>\n",
" <td> 478</td>\n",
" <td> 30</td>\n",
" </tr>\n",
" <tr>\n",
" <th>There's something about St. Tropez :</th>\n",
" <th>There is something about Saint-Tropez.</th>\n",
" <td> 476</td>\n",
" <td> 42</td>\n",
" </tr>\n",
" <tr>\n",
" <th>First family /</th>\n",
" <th>1st family.</th>\n",
" <td> 476</td>\n",
" <td> 46</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sizzling sixteen :</th>\n",
" <th>Sizzling 16</th>\n",
" <td> 465</td>\n",
" <td> 51</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The Clifton chronicles.</th>\n",
" <th>Sins of the father</th>\n",
" <td> 460</td>\n",
" <td> 111</td>\n",
" </tr>\n",
" <tr>\n",
" <th>For one more day /</th>\n",
" <th>For 1 more day.</th>\n",
" <td> 442</td>\n",
" <td> 51</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11th hour /</th>\n",
" <th>Eleventh hour</th>\n",
" <td> 440</td>\n",
" <td> 128</td>\n",
" </tr>\n",
" <tr>\n",
" <th>At first sight /</th>\n",
" <th>At 1st sight.</th>\n",
" <td> 431</td>\n",
" <td> 45</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Now and then :</th>\n",
" <th>Now &amp; then.</th>\n",
" <td> 431</td>\n",
" <td> 33</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Explosive eighteen :</th>\n",
" <th>Explosive 18</th>\n",
" <td> 426</td>\n",
" <td> 80</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Honor thyself /</th>\n",
" <th>Honour thyself</th>\n",
" <td> 425</td>\n",
" <td> 36</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Eight days to live :</th>\n",
" <th>8 days to live</th>\n",
" <td> 416</td>\n",
" <td> 44</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Lean mean thirteen :</th>\n",
" <th>Lean mean 13.</th>\n",
" <td> 414</td>\n",
" <td> 28</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Robert Ludlum's the Bourne deception :</th>\n",
" <th>Bourne deception.</th>\n",
" <td> 407</td>\n",
" <td> 28</td>\n",
" </tr>\n",
" <tr>\n",
" <th>KnockOut :</th>\n",
" <th>Knock out</th>\n",
" <td> 406</td>\n",
" <td> 42</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Heartstopper :</th>\n",
" <th>Heart stopper</th>\n",
" <td> 400</td>\n",
" <td> 31</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Bones :</th>\n",
" <th>Alex Delaware novel.</th>\n",
" <td> 393</td>\n",
" <td> 40</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The first rule :</th>\n",
" <th>1st rule</th>\n",
" <td> 390</td>\n",
" <td> 35</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Eleven minutes :</th>\n",
" <th>11 minutes.</th>\n",
" <td> 378</td>\n",
" <td> 22</td>\n",
" </tr>\n",
" <tr>\n",
" <td></td>\n",
" <td></td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>5021 rows \u00d7 2 columns</p>\n",
"</div>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 99,
"text": [
" total_loans \\\n",
"title variant \n",
"Millennium. Girl with the dragon tattoo. 1244 \n",
"Nine dragons : 9 dragons 998 \n",
"Fifty shades. Fifty shades of Grey 916 \n",
"The lucky one : Lucky 1. 897 \n",
"Millennium. Girl who kicked the hornets' nest 892 \n",
" Girl who played with fire 882 \n",
"Twenties girl : 20's girl. 822 \n",
"61 hours : Sixty-one hours 802 \n",
"10th anniversary / Tenth anniversary 716 \n",
"I'll walk alone : I will walk alone 715 \n",
"206 bones : Two hundred six bones. 708 \n",
"The fifth witness : 5th witness 707 \n",
"One day at a time / 1 day at a time. 698 \n",
"A thousand splendid suns : A 1, 000 splendid suns. 677 \n",
"Fifty shades. Fifty shades darker 675 \n",
"44 Charles Street : Forty-four Charles Street 672 \n",
"The Inn Boonsboro. Next always 645 \n",
"Don't blink : Do not blink 632 \n",
"The 6th target / Sixth target 632 \n",
"Love the one you're with / Love the one you are with 603 \n",
"You've been warned : You have been warned. 589 \n",
"The 8th confession / Eighth confession. 588 \n",
"The sixth man / 6th man 585 \n",
"Fearless fourteen : Fearless 14. 580 \n",
"The 9th judgment / Ninth judgment 579 \n",
"Zero day : 0 day 565 \n",
"The Hunger Games. Catching fire 554 \n",
"Fire and ice : Fire & ice. 553 \n",
"I've got your number : I have got your number 548 \n",
"7th heaven / Seventh heaven 547 \n",
"Beatrice & Virgil : Beatrice and Virgil 543 \n",
"Smokin' seventeen : Smoking 17 540 \n",
"Fifty shades. 50 shades freed 535 \n",
"Finger lickin' fifteen : Finger lickin' 15. 533 \n",
"Alex Cross's trial / Trial. 521 \n",
"Ice cold : Rizzoli and Isles 518 \n",
"11/22/63 : Eleven twenty-two sixty-three 516 \n",
"The Clifton chronicles. Only time will tell 508 \n",
"One summer / 1 summer 493 \n",
"The Inn Boonsboro. Last boyfriend 491 \n",
"Code to zero / Code to 0. 478 \n",
"Hunger Games. Mockingjay 478 \n",
"There's something about St. Tropez : There is something about Saint-Tropez. 476 \n",
"First family / 1st family. 476 \n",
"Sizzling sixteen : Sizzling 16 465 \n",
"The Clifton chronicles. Sins of the father 460 \n",
"For one more day / For 1 more day. 442 \n",
"11th hour / Eleventh hour 440 \n",
"At first sight / At 1st sight. 431 \n",
"Now and then : Now & then. 431 \n",
"Explosive eighteen : Explosive 18 426 \n",
"Honor thyself / Honour thyself 425 \n",
"Eight days to live : 8 days to live 416 \n",
"Lean mean thirteen : Lean mean 13. 414 \n",
"Robert Ludlum's the Bourne deception : Bourne deception. 407 \n",
"KnockOut : Knock out 406 \n",
"Heartstopper : Heart stopper 400 \n",
"Bones : Alex Delaware novel. 393 \n",
"The first rule : 1st rule 390 \n",
"Eleven minutes : 11 minutes. 378 \n",
" ... \n",
"\n",
" year_loans \n",
"title variant \n",
"Millennium. Girl with the dragon tattoo. 68 \n",
"Nine dragons : 9 dragons 99 \n",
"Fifty shades. Fifty shades of Grey 107 \n",
"The lucky one : Lucky 1. 64 \n",
"Millennium. Girl who kicked the hornets' nest 81 \n",
" Girl who played with fire 55 \n",
"Twenties girl : 20's girl. 50 \n",
"61 hours : Sixty-one hours 107 \n",
"10th anniversary / Tenth anniversary 74 \n",
"I'll walk alone : I will walk alone 109 \n",
"206 bones : Two hundred six bones. 60 \n",
"The fifth witness : 5th witness 68 \n",
"One day at a time / 1 day at a time. 48 \n",
"A thousand splendid suns : A 1, 000 splendid suns. 36 \n",
"Fifty shades. Fifty shades darker 73 \n",
"44 Charles Street : Forty-four Charles Street 87 \n",
"The Inn Boonsboro. Next always 77 \n",
"Don't blink : Do not blink 58 \n",
"The 6th target / Sixth target 68 \n",
"Love the one you're with / Love the one you are with 48 \n",
"You've been warned : You have been warned. 43 \n",
"The 8th confession / Eighth confession. 62 \n",
"The sixth man / 6th man 62 \n",
"Fearless fourteen : Fearless 14. 49 \n",
"The 9th judgment / Ninth judgment 39 \n",
"Zero day : 0 day 63 \n",
"The Hunger Games. Catching fire 43 \n",
"Fire and ice : Fire & ice. 49 \n",
"I've got your number : I have got your number 69 \n",
"7th heaven / Seventh heaven 52 \n",
"Beatrice & Virgil : Beatrice and Virgil 45 \n",
"Smokin' seventeen : Smoking 17 61 \n",
"Fifty shades. 50 shades freed 52 \n",
"Finger lickin' fifteen : Finger lickin' 15. 36 \n",
"Alex Cross's trial / Trial. 44 \n",
"Ice cold : Rizzoli and Isles 43 \n",
"11/22/63 : Eleven twenty-two sixty-three 94 \n",
"The Clifton chronicles. Only time will tell 90 \n",
"One summer / 1 summer 64 \n",
"The Inn Boonsboro. Last boyfriend 85 \n",
"Code to zero / Code to 0. 48 \n",
"Hunger Games. Mockingjay 30 \n",
"There's something about St. Tropez : There is something about Saint-Tropez. 42 \n",
"First family / 1st family. 46 \n",
"Sizzling sixteen : Sizzling 16 51 \n",
"The Clifton chronicles. Sins of the father 111 \n",
"For one more day / For 1 more day. 51 \n",
"11th hour / Eleventh hour 128 \n",
"At first sight / At 1st sight. 45 \n",
"Now and then : Now & then. 33 \n",
"Explosive eighteen : Explosive 18 80 \n",
"Honor thyself / Honour thyself 36 \n",
"Eight days to live : 8 days to live 44 \n",
"Lean mean thirteen : Lean mean 13. 28 \n",
"Robert Ludlum's the Bourne deception : Bourne deception. 28 \n",
"KnockOut : Knock out 42 \n",
"Heartstopper : Heart stopper 31 \n",
"Bones : Alex Delaware novel. 40 \n",
"The first rule : 1st rule 35 \n",
"Eleven minutes : 11 minutes. 22 \n",
" ... \n",
"\n",
"[5021 rows x 2 columns]"
]
}
],
"prompt_number": 99
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Do the same for French adult fiction"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"fre_fiction = data[(data.type == 'LV_Fiction A' ) & (data.language == 'fre')]\n",
"fre_counts = fre_fiction.groupby(['title', 'variant'])\n",
"fre_counts.aggregate(np.sum).sort('total_loans', ascending=False)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th></th>\n",
" <th>total_loans</th>\n",
" <th>year_loans</th>\n",
" </tr>\n",
" <tr>\n",
" <th>title</th>\n",
" <th>variant</th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>A.N.G.E.</th>\n",
" <th>Agence nationale de gestion de l'\u00c3\u0089trange.</th>\n",
" <td> 4519</td>\n",
" <td> 382</td>\n",
" </tr>\n",
" <tr>\n",
" <th>M\u00c3\u00a9moires d'un quartier.</th>\n",
" <th>Laura</th>\n",
" <td> 3779</td>\n",
" <td> 187</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Aya de Yopougon.</th>\n",
" <th>Aya.</th>\n",
" <td> 3466</td>\n",
" <td> 317</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Le ma\u00c3\u00aetre magicien Negi Ma!.</th>\n",
" <th>Ma\u00c3\u00aetre magicien Negima!.</th>\n",
" <td> 3270</td>\n",
" <td> 259</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Magasin g\u00c3\u00a9n\u00c3\u00a9ral.</th>\n",
" <th>Hommes</th>\n",
" <td> 3202</td>\n",
" <td> 162</td>\n",
" </tr>\n",
" <tr>\n",
" <th>M\u00c3\u00a9moires d'un quartier.</th>\n",
" <th>Antoine, 1957-1958</th>\n",
" <td> 3079</td>\n",
" <td> 172</td>\n",
" </tr>\n",
" <tr>\n",
" <th>\u00c3\u0080 l'ombre du clocher.</th>\n",
" <th>Ann\u00c3\u00a9es folles.</th>\n",
" <td> 3016</td>\n",
" <td> 98</td>\n",
" </tr>\n",
" <tr>\n",
" <th>La derni\u00c3\u00a8re saison.</th>\n",
" <th>Jeanne.</th>\n",
" <td> 2955</td>\n",
" <td> 142</td>\n",
" </tr>\n",
" <tr>\n",
" <th>\u00c3\u0080 l'ombre du clocher.</th>\n",
" <th>Fils de Gabrielle</th>\n",
" <td> 2891</td>\n",
" <td> 124</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mill\u00c3\u00a9nium.</th>\n",
" <th>Hommes qui n'aimaient pas les femmes.</th>\n",
" <td> 2869</td>\n",
" <td> 168</td>\n",
" </tr>\n",
" <tr>\n",
" <th>La poussi\u00c3\u00a8re du temps.</th>\n",
" <th>Rue de la Glaci\u00c3\u00a8re.</th>\n",
" <td> 2845</td>\n",
" <td> 139</td>\n",
" </tr>\n",
" <tr>\n",
" <th>M\u00c3\u00a9moires d'un quartier.</th>\n",
" <th>\u00c3\u0089vang\u00c3\u00a9line, 1958-1959.</th>\n",
" <td> 2833</td>\n",
" <td> 195</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ch\u00c3\u00a8re Laurette.</th>\n",
" <th>Des r\u00c3\u00aaves plein la t\u00c3\u00aate</th>\n",
" <td> 2831</td>\n",
" <td> 166</td>\n",
" </tr>\n",
" <tr>\n",
" <th>\u00c3\u0080 l'ombre du clocher.</th>\n",
" <th>Amours interdites.</th>\n",
" <td> 2770</td>\n",
" <td> 116</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Au bord de la rivi\u00c3\u00a8re.</th>\n",
" <th>Baptiste</th>\n",
" <td> 2743</td>\n",
" <td> 194</td>\n",
" </tr>\n",
" <tr>\n",
" <th>La derni\u00c3\u00a8re saison.</th>\n",
" <th>Thomas</th>\n",
" <td> 2717</td>\n",
" <td> 172</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Un bonheur si fragile.</th>\n",
" <th>Drame</th>\n",
" <td> 2717</td>\n",
" <td> 180</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ikigami, pr\u00c3\u00a9avis de mort.</th>\n",
" <th>Ikigami.</th>\n",
" <td> 2704</td>\n",
" <td> 434</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mill\u00c3\u00a9nium.</th>\n",
" <th>Reine dans le palais des courants d'air</th>\n",
" <td> 2679</td>\n",
" <td> 163</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Un bonheur si fragile.</th>\n",
" <th>Engagement</th>\n",
" <td> 2623</td>\n",
" <td> 170</td>\n",
" </tr>\n",
" <tr>\n",
" <th>M\u00c3\u00a9moires d'un quartier.</th>\n",
" <th>Bernadette, 1960-1962</th>\n",
" <td> 2590</td>\n",
" <td> 226</td>\n",
" </tr>\n",
" <tr>\n",
" <th>La poussi\u00c3\u00a8re du temps.</th>\n",
" <th>Sur le boulevard.</th>\n",
" <td> 2578</td>\n",
" <td> 115</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Les portes de Qu\u00c3\u00a9bec.</th>\n",
" <th>Faubourg Saint-Roch</th>\n",
" <td> 2523</td>\n",
" <td> 93</td>\n",
" </tr>\n",
" <tr>\n",
" <th>La poussi\u00c3\u00a8re du temps.</th>\n",
" <th>Au bout de la route.</th>\n",
" <td> 2495</td>\n",
" <td> 102</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ch\u00c3\u00a8re Laurette.</th>\n",
" <th>Retour</th>\n",
" <td> 2489</td>\n",
" <td> 141</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"2\" valign=\"top\">M\u00c3\u00a9moires d'un quartier.</th>\n",
" <th>Adrien, 1962-1963</th>\n",
" <td> 2477</td>\n",
" <td> 238</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Marcel, 1965-1966</th>\n",
" <td> 2450</td>\n",
" <td> 216</td>\n",
" </tr>\n",
" <tr>\n",
" <th>\u00c3\u0080 l'ombre du clocher.</th>\n",
" <th>Au rythme des saisons</th>\n",
" <td> 2442</td>\n",
" <td> 132</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Au bord de la rivi\u00c3\u00a8re.</th>\n",
" <th>Camille</th>\n",
" <td> 2440</td>\n",
" <td> 259</td>\n",
" </tr>\n",
" <tr>\n",
" <th>M\u00c3\u00a9moires d'un quartier.</th>\n",
" <th>Francine, 1963-1965</th>\n",
" <td> 2435</td>\n",
" <td> 239</td>\n",
" </tr>\n",
" <tr>\n",
" <th>La premi\u00c3\u00a8re nuit :</th>\n",
" <th>1\u00c3\u00a8re nuit</th>\n",
" <td> 2380</td>\n",
" <td> 179</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mill\u00c3\u00a9nium.</th>\n",
" <th>Fille qui r\u00c3\u00aavait d'un bidon d'essence et d'une allumette.</th>\n",
" <td> 2377</td>\n",
" <td> 138</td>\n",
" </tr>\n",
" <tr>\n",
" <th>M\u00c3\u00a9moires d'un quartier.</th>\n",
" <th>Antoine, la suite, 1968-1969</th>\n",
" <td> 2294</td>\n",
" <td> 247</td>\n",
" </tr>\n",
" <tr>\n",
" <th>La diaspora des Desrosiers.</th>\n",
" <th>Travers\u00c3\u00a9e du continent</th>\n",
" <td> 2269</td>\n",
" <td> 132</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Les soeurs Deblois.</th>\n",
" <th>Charlotte</th>\n",
" <td> 2266</td>\n",
" <td> 122</td>\n",
" </tr>\n",
" <tr>\n",
" <th>M\u00c3\u00a9moires d'un quartier.</th>\n",
" <th>Laura, la suite, 1966-1968</th>\n",
" <td> 2246</td>\n",
" <td> 259</td>\n",
" </tr>\n",
" <tr>\n",
" <th>La poussi\u00c3\u00a8re du temps.</th>\n",
" <th>Rue Notre-Dame.</th>\n",
" <td> 2246</td>\n",
" <td> 122</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ch\u00c3\u00a8re Laurette.</th>\n",
" <th>\u00c3\u0080 l'\u00c3\u00a9coute du temps</th>\n",
" <td> 2243</td>\n",
" <td> 165</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Un bonheur si fragile.</th>\n",
" <th>Amours :</th>\n",
" <td> 2242</td>\n",
" <td> 263</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Hell.com /</th>\n",
" <th>Hell com</th>\n",
" <td> 2188</td>\n",
" <td> 167</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Les folles ann\u00c3\u00a9es.</th>\n",
" <th>H\u00c3\u00a9ritiers :</th>\n",
" <td> 2169</td>\n",
" <td> 145</td>\n",
" </tr>\n",
" <tr>\n",
" <th>M\u00c3\u00a9moires d'un quartier.</th>\n",
" <th>\u00c3\u0089vang\u00c3\u00a9line, la suite, 1969-1970</th>\n",
" <td> 2158</td>\n",
" <td> 312</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Fanette.</th>\n",
" <th>\u00c3\u0080 la conqu\u00c3\u00aate de la haute ville</th>\n",
" <td> 2144</td>\n",
" <td> 88</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Un bonheur si fragile.</th>\n",
" <th>\u00c3\u0089preuves</th>\n",
" <td> 2122</td>\n",
" <td> 145</td>\n",
" </tr>\n",
" <tr>\n",
" <th>M\u00c3\u00a9moires d'un quartier.</th>\n",
" <th>Bernadette, la suite, 1970-1972</th>\n",
" <td> 2115</td>\n",
" <td> 314</td>\n",
" </tr>\n",
" <tr>\n",
" <th>La force de vivre.</th>\n",
" <th>R\u00c3\u00aaves d'Edmond et \u00c3\u0089milie</th>\n",
" <td> 2101</td>\n",
" <td> 89</td>\n",
" </tr>\n",
" <tr>\n",
" <th>XXX holic.</th>\n",
" <th>XXXholic.</th>\n",
" <td> 2094</td>\n",
" <td> 304</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Quatre saisons de fian\u00c3\u00a7ailles.</th>\n",
" <th>R\u00c3\u00aaves en blanc</th>\n",
" <td> 2076</td>\n",
" <td> 134</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Magasin g\u00c3\u00a9n\u00c3\u00a9ral.</th>\n",
" <th>Marie</th>\n",
" <td> 2072</td>\n",
" <td> 121</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ch\u00c3\u00a8re Laurette.</th>\n",
" <th>Fuite du temps</th>\n",
" <td> 2071</td>\n",
" <td> 177</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"2\" valign=\"top\">Les soeurs Deblois.</th>\n",
" <th>\u00c3\u0089milie</th>\n",
" <td> 2057</td>\n",
" <td> 129</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Anne</th>\n",
" <td> 2051</td>\n",
" <td> 137</td>\n",
" </tr>\n",
" <tr>\n",
" <th>La diaspora des Desrosiers.</th>\n",
" <th>Travers\u00c3\u00a9e de la ville.</th>\n",
" <td> 2043</td>\n",
" <td> 133</td>\n",
" </tr>\n",
" <tr>\n",
" <th>F\u00c3\u00a9licit\u00c3\u00a9.</th>\n",
" <th>Pasteur et la brebis</th>\n",
" <td> 2038</td>\n",
" <td> 170</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Au bord de la rivi\u00c3\u00a8re.</th>\n",
" <th>Xavier</th>\n",
" <td> 2033</td>\n",
" <td> 323</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Quatre jours de pluie :</th>\n",
" <th>4 jours de pluie</th>\n",
" <td> 2015</td>\n",
" <td> 188</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Les soeurs Deblois.</th>\n",
" <th>Demi-fr\u00c3\u00a8re</th>\n",
" <td> 1994</td>\n",
" <td> 135</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"2\" valign=\"top\">Les ann\u00c3\u00a9es du silence.</th>\n",
" <th>D\u00c3\u00a9livrance</th>\n",
" <td> 1972</td>\n",
" <td> 98</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Tourmente</th>\n",
" <td> 1942</td>\n",
" <td> 86</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sept jours pour une \u00c3\u00a9ternit\u00c3\u00a9-- :</th>\n",
" <th>7 jours pour une \u00c3\u00a9ternit\u00c3\u00a9 --</th>\n",
" <td> 1936</td>\n",
" <td> 94</td>\n",
" </tr>\n",
" <tr>\n",
" <td></td>\n",
" <td></td>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>17185 rows \u00d7 2 columns</p>\n",
"</div>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 111,
"text": [
" total_loans \\\n",
"title variant \n",
"A.N.G.E. Agence nationale de gestion de l'\u00c3\u0089trange. 4519 \n",
"M\u00c3\u00a9moires d'un quartier. Laura 3779 \n",
"Aya de Yopougon. Aya. 3466 \n",
"Le ma\u00c3\u00aetre magicien Negi Ma!. Ma\u00c3\u00aetre magicien Negima!. 3270 \n",
"Magasin g\u00c3\u00a9n\u00c3\u00a9ral. Hommes 3202 \n",
"M\u00c3\u00a9moires d'un quartier. Antoine, 1957-1958 3079 \n",
"\u00c3\u0080 l'ombre du clocher. Ann\u00c3\u00a9es folles. 3016 \n",
"La derni\u00c3\u00a8re saison. Jeanne. 2955 \n",
"\u00c3\u0080 l'ombre du clocher. Fils de Gabrielle 2891 \n",
"Mill\u00c3\u00a9nium. Hommes qui n'aimaient pas les femmes. 2869 \n",
"La poussi\u00c3\u00a8re du temps. Rue de la Glaci\u00c3\u00a8re. 2845 \n",
"M\u00c3\u00a9moires d'un quartier. \u00c3\u0089vang\u00c3\u00a9line, 1958-1959. 2833 \n",
"Ch\u00c3\u00a8re Laurette. Des r\u00c3\u00aaves plein la t\u00c3\u00aate 2831 \n",
"\u00c3\u0080 l'ombre du clocher. Amours interdites. 2770 \n",
"Au bord de la rivi\u00c3\u00a8re. Baptiste 2743 \n",
"La derni\u00c3\u00a8re saison. Thomas 2717 \n",
"Un bonheur si fragile. Drame 2717 \n",
"Ikigami, pr\u00c3\u00a9avis de mort. Ikigami. 2704 \n",
"Mill\u00c3\u00a9nium. Reine dans le palais des courants d'air 2679 \n",
"Un bonheur si fragile. Engagement 2623 \n",
"M\u00c3\u00a9moires d'un quartier. Bernadette, 1960-1962 2590 \n",
"La poussi\u00c3\u00a8re du temps. Sur le boulevard. 2578 \n",
"Les portes de Qu\u00c3\u00a9bec. Faubourg Saint-Roch 2523 \n",
"La poussi\u00c3\u00a8re du temps. Au bout de la route. 2495 \n",
"Ch\u00c3\u00a8re Laurette. Retour 2489 \n",
"M\u00c3\u00a9moires d'un quartier. Adrien, 1962-1963 2477 \n",
" Marcel, 1965-1966 2450 \n",
"\u00c3\u0080 l'ombre du clocher. Au rythme des saisons 2442 \n",
"Au bord de la rivi\u00c3\u00a8re. Camille 2440 \n",
"M\u00c3\u00a9moires d'un quartier. Francine, 1963-1965 2435 \n",
"La premi\u00c3\u00a8re nuit : 1\u00c3\u00a8re nuit 2380 \n",
"Mill\u00c3\u00a9nium. Fille qui r\u00c3\u00aavait d'un bidon d'essence et d'une allumette. 2377 \n",
"M\u00c3\u00a9moires d'un quartier. Antoine, la suite, 1968-1969 2294 \n",
"La diaspora des Desrosiers. Travers\u00c3\u00a9e du continent 2269 \n",
"Les soeurs Deblois. Charlotte 2266 \n",
"M\u00c3\u00a9moires d'un quartier. Laura, la suite, 1966-1968 2246 \n",
"La poussi\u00c3\u00a8re du temps. Rue Notre-Dame. 2246 \n",
"Ch\u00c3\u00a8re Laurette. \u00c3\u0080 l'\u00c3\u00a9coute du temps 2243 \n",
"Un bonheur si fragile. Amours : 2242 \n",
"Hell.com / Hell com 2188 \n",
"Les folles ann\u00c3\u00a9es. H\u00c3\u00a9ritiers : 2169 \n",
"M\u00c3\u00a9moires d'un quartier. \u00c3\u0089vang\u00c3\u00a9line, la suite, 1969-1970 2158 \n",
"Fanette. \u00c3\u0080 la conqu\u00c3\u00aate de la haute ville 2144 \n",
"Un bonheur si fragile. \u00c3\u0089preuves 2122 \n",
"M\u00c3\u00a9moires d'un quartier. Bernadette, la suite, 1970-1972 2115 \n",
"La force de vivre. R\u00c3\u00aaves d'Edmond et \u00c3\u0089milie 2101 \n",
"XXX holic. XXXholic. 2094 \n",
"Quatre saisons de fian\u00c3\u00a7ailles. R\u00c3\u00aaves en blanc 2076 \n",
"Magasin g\u00c3\u00a9n\u00c3\u00a9ral. Marie 2072 \n",
"Ch\u00c3\u00a8re Laurette. Fuite du temps 2071 \n",
"Les soeurs Deblois. \u00c3\u0089milie 2057 \n",
" Anne 2051 \n",
"La diaspora des Desrosiers. Travers\u00c3\u00a9e de la ville. 2043 \n",
"F\u00c3\u00a9licit\u00c3\u00a9. Pasteur et la brebis 2038 \n",
"Au bord de la rivi\u00c3\u00a8re. Xavier 2033 \n",
"Quatre jours de pluie : 4 jours de pluie 2015 \n",
"Les soeurs Deblois. Demi-fr\u00c3\u00a8re 1994 \n",
"Les ann\u00c3\u00a9es du silence. D\u00c3\u00a9livrance 1972 \n",
" Tourmente 1942 \n",
"Sept jours pour une \u00c3\u00a9ternit\u00c3\u00a9-- : 7 jours pour une \u00c3\u00a9ternit\u00c3\u00a9 -- 1936 \n",
" ... \n",
"\n",
" year_loans \n",
"title variant \n",
"A.N.G.E. Agence nationale de gestion de l'\u00c3\u0089trange. 382 \n",
"M\u00c3\u00a9moires d'un quartier. Laura 187 \n",
"Aya de Yopougon. Aya. 317 \n",
"Le ma\u00c3\u00aetre magicien Negi Ma!. Ma\u00c3\u00aetre magicien Negima!. 259 \n",
"Magasin g\u00c3\u00a9n\u00c3\u00a9ral. Hommes 162 \n",
"M\u00c3\u00a9moires d'un quartier. Antoine, 1957-1958 172 \n",
"\u00c3\u0080 l'ombre du clocher. Ann\u00c3\u00a9es folles. 98 \n",
"La derni\u00c3\u00a8re saison. Jeanne. 142 \n",
"\u00c3\u0080 l'ombre du clocher. Fils de Gabrielle 124 \n",
"Mill\u00c3\u00a9nium. Hommes qui n'aimaient pas les femmes. 168 \n",
"La poussi\u00c3\u00a8re du temps. Rue de la Glaci\u00c3\u00a8re. 139 \n",
"M\u00c3\u00a9moires d'un quartier. \u00c3\u0089vang\u00c3\u00a9line, 1958-1959. 195 \n",
"Ch\u00c3\u00a8re Laurette. Des r\u00c3\u00aaves plein la t\u00c3\u00aate 166 \n",
"\u00c3\u0080 l'ombre du clocher. Amours interdites. 116 \n",
"Au bord de la rivi\u00c3\u00a8re. Baptiste 194 \n",
"La derni\u00c3\u00a8re saison. Thomas 172 \n",
"Un bonheur si fragile. Drame 180 \n",
"Ikigami, pr\u00c3\u00a9avis de mort. Ikigami. 434 \n",
"Mill\u00c3\u00a9nium. Reine dans le palais des courants d'air 163 \n",
"Un bonheur si fragile. Engagement 170 \n",
"M\u00c3\u00a9moires d'un quartier. Bernadette, 1960-1962 226 \n",
"La poussi\u00c3\u00a8re du temps. Sur le boulevard. 115 \n",
"Les portes de Qu\u00c3\u00a9bec. Faubourg Saint-Roch 93 \n",
"La poussi\u00c3\u00a8re du temps. Au bout de la route. 102 \n",
"Ch\u00c3\u00a8re Laurette. Retour 141 \n",
"M\u00c3\u00a9moires d'un quartier. Adrien, 1962-1963 238 \n",
" Marcel, 1965-1966 216 \n",
"\u00c3\u0080 l'ombre du clocher. Au rythme des saisons 132 \n",
"Au bord de la rivi\u00c3\u00a8re. Camille 259 \n",
"M\u00c3\u00a9moires d'un quartier. Francine, 1963-1965 239 \n",
"La premi\u00c3\u00a8re nuit : 1\u00c3\u00a8re nuit 179 \n",
"Mill\u00c3\u00a9nium. Fille qui r\u00c3\u00aavait d'un bidon d'essence et d'une allumette. 138 \n",
"M\u00c3\u00a9moires d'un quartier. Antoine, la suite, 1968-1969 247 \n",
"La diaspora des Desrosiers. Travers\u00c3\u00a9e du continent 132 \n",
"Les soeurs Deblois. Charlotte 122 \n",
"M\u00c3\u00a9moires d'un quartier. Laura, la suite, 1966-1968 259 \n",
"La poussi\u00c3\u00a8re du temps. Rue Notre-Dame. 122 \n",
"Ch\u00c3\u00a8re Laurette. \u00c3\u0080 l'\u00c3\u00a9coute du temps 165 \n",
"Un bonheur si fragile. Amours : 263 \n",
"Hell.com / Hell com 167 \n",
"Les folles ann\u00c3\u00a9es. H\u00c3\u00a9ritiers : 145 \n",
"M\u00c3\u00a9moires d'un quartier. \u00c3\u0089vang\u00c3\u00a9line, la suite, 1969-1970 312 \n",
"Fanette. \u00c3\u0080 la conqu\u00c3\u00aate de la haute ville 88 \n",
"Un bonheur si fragile. \u00c3\u0089preuves 145 \n",
"M\u00c3\u00a9moires d'un quartier. Bernadette, la suite, 1970-1972 314 \n",
"La force de vivre. R\u00c3\u00aaves d'Edmond et \u00c3\u0089milie 89 \n",
"XXX holic. XXXholic. 304 \n",
"Quatre saisons de fian\u00c3\u00a7ailles. R\u00c3\u00aaves en blanc 134 \n",
"Magasin g\u00c3\u00a9n\u00c3\u00a9ral. Marie 121 \n",
"Ch\u00c3\u00a8re Laurette. Fuite du temps 177 \n",
"Les soeurs Deblois. \u00c3\u0089milie 129 \n",
" Anne 137 \n",
"La diaspora des Desrosiers. Travers\u00c3\u00a9e de la ville. 133 \n",
"F\u00c3\u00a9licit\u00c3\u00a9. Pasteur et la brebis 170 \n",
"Au bord de la rivi\u00c3\u00a8re. Xavier 323 \n",
"Quatre jours de pluie : 4 jours de pluie 188 \n",
"Les soeurs Deblois. Demi-fr\u00c3\u00a8re 135 \n",
"Les ann\u00c3\u00a9es du silence. D\u00c3\u00a9livrance 98 \n",
" Tourmente 86 \n",
"Sept jours pour une \u00c3\u00a9ternit\u00c3\u00a9-- : 7 jours pour une \u00c3\u00a9ternit\u00c3\u00a9 -- 94 \n",
" ... \n",
"\n",
"[17185 rows x 2 columns]"
]
}
],
"prompt_number": 111
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"What about French non-fiction?"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"fre_non_fiction = data[(data.type == 'LV_Documentaire A' ) & (data.language == 'fre')]\n",
"fre_nf_counts = fre_non_fiction.groupby(['title'])\n",
"fre_nf_counts.aggregate(np.sum).sort('total_loans', ascending=False)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>total_loans</th>\n",
" <th>year_loans</th>\n",
" </tr>\n",
" <tr>\n",
" <th>title</th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Conduire un v\u00c3\u00a9hicule de promenade /</th>\n",
" <td> 10016</td>\n",
" <td> 418</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Guide de la route /</th>\n",
" <td> 8954</td>\n",
" <td> 453</td>\n",
" </tr>\n",
" <tr>\n",
" <th>New York /</th>\n",
" <td> 7496</td>\n",
" <td> 1084</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Cuba /</th>\n",
" <td> 5233</td>\n",
" <td> 440</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Paris /</th>\n",
" <td> 4972</td>\n",
" <td> 582</td>\n",
" </tr>\n",
" <tr>\n",
" <th>La grammaire pour tous :</th>\n",
" <td> 3485</td>\n",
" <td> 218</td>\n",
" </tr>\n",
" <tr>\n",
" <th>L'art de conjuguer :</th>\n",
" <td> 3443</td>\n",
" <td> 286</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rome /</th>\n",
" <td> 3239</td>\n",
" <td> 502</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Costa Rica /</th>\n",
" <td> 3173</td>\n",
" <td> 228</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mexique /</th>\n",
" <td> 3134</td>\n",
" <td> 284</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Portugal /</th>\n",
" <td> 3105</td>\n",
" <td> 365</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Londres /</th>\n",
" <td> 2933</td>\n",
" <td> 472</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Math-o-matique :</th>\n",
" <td> 2903</td>\n",
" <td> 188</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pour r\u00c3\u00a9ussir math 436 :</th>\n",
" <td> 2476</td>\n",
" <td> 194</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Tha\u00c3\u00aflande /</th>\n",
" <td> 2440</td>\n",
" <td> 288</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Barcelone /</th>\n",
" <td> 2378</td>\n",
" <td> 304</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Vietnam /</th>\n",
" <td> 2373</td>\n",
" <td> 197</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Turquie /</th>\n",
" <td> 2358</td>\n",
" <td> 361</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Italie /</th>\n",
" <td> 2349</td>\n",
" <td> 247</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Maroc /</th>\n",
" <td> 2283</td>\n",
" <td> 386</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Chine /</th>\n",
" <td> 2271</td>\n",
" <td> 309</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Floride /</th>\n",
" <td> 2249</td>\n",
" <td> 211</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Le dessin de manga.</th>\n",
" <td> 2217</td>\n",
" <td> 202</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Le secret /</th>\n",
" <td> 2211</td>\n",
" <td> 107</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Espagne /</th>\n",
" <td> 2186</td>\n",
" <td> 250</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mange, prie, aime :</th>\n",
" <td> 2091</td>\n",
" <td> 61</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Venise /</th>\n",
" <td> 2050</td>\n",
" <td> 414</td>\n",
" </tr>\n",
" <tr>\n",
" <th>La vie comme je l'aime.</th>\n",
" <td> 1977</td>\n",
" <td> 246</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Conduire un v\u00c3\u00a9hicule lourd /</th>\n",
" <td> 1958</td>\n",
" <td> 159</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Californie /</th>\n",
" <td> 1895</td>\n",
" <td> 250</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ma grammaire /</th>\n",
" <td> 1879</td>\n",
" <td> 156</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Oeuvres compl\u00c3\u00a8tes /</th>\n",
" <td> 1871</td>\n",
" <td> 313</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Croatie /</th>\n",
" <td> 1831</td>\n",
" <td> 280</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Parce qu'on a tous de la visite-- :</th>\n",
" <td> 1809</td>\n",
" <td> 87</td>\n",
" </tr>\n",
" <tr>\n",
" <th>L'orthographe pour tous :</th>\n",
" <td> 1804</td>\n",
" <td> 188</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Prague /</th>\n",
" <td> 1701</td>\n",
" <td> 272</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Provence /</th>\n",
" <td> 1693</td>\n",
" <td> 276</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Oeuvres /</th>\n",
" <td> 1677</td>\n",
" <td> 249</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Argentine /</th>\n",
" <td> 1663</td>\n",
" <td> 229</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pasta et cetera \u00c3\u00a0 la di Stasio :</th>\n",
" <td> 1636</td>\n",
" <td> 73</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Canada /</th>\n",
" <td> 1605</td>\n",
" <td> 341</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Comment j'ai vaincu la douleur et l'inflammation chronique par l'alimentation /</th>\n",
" <td> 1514</td>\n",
" <td> 87</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Chagrin d'\u00c3\u00a9cole /</th>\n",
" <td> 1512</td>\n",
" <td> 93</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Inde /</th>\n",
" <td> 1510</td>\n",
" <td> 193</td>\n",
" </tr>\n",
" <tr>\n",
" <th>France /</th>\n",
" <td> 1491</td>\n",
" <td> 180</td>\n",
" </tr>\n",
" <tr>\n",
" <th>P\u00c3\u00a9rou /</th>\n",
" <td> 1461</td>\n",
" <td> 203</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Japon /</th>\n",
" <td> 1440</td>\n",
" <td> 189</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Boston /</th>\n",
" <td> 1434</td>\n",
" <td> 265</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Qu\u00c3\u00a9bec /</th>\n",
" <td> 1432</td>\n",
" <td> 304</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Histoire populaire du Qu\u00c3\u00a9bec /</th>\n",
" <td> 1381</td>\n",
" <td> 199</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Corse /</th>\n",
" <td> 1358</td>\n",
" <td> 263</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Janine Sutto :</th>\n",
" <td> 1354</td>\n",
" <td> 144</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Berlin /</th>\n",
" <td> 1347</td>\n",
" <td> 213</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Cuisiner avec les aliments contre le cancer /</th>\n",
" <td> 1343</td>\n",
" <td> 104</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Irlande /</th>\n",
" <td> 1320</td>\n",
" <td> 283</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Andalousie /</th>\n",
" <td> 1298</td>\n",
" <td> 195</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Entre cuisine et quincaillerie /</th>\n",
" <td> 1293</td>\n",
" <td> 77</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Le fran\u00c3\u00a7ais au bureau /</th>\n",
" <td> 1260</td>\n",
" <td> 93</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Le meilleur de soi /</th>\n",
" <td> 1245</td>\n",
" <td> 79</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Nouvelle-Angleterre /</th>\n",
" <td> 1241</td>\n",
" <td> 254</td>\n",
" </tr>\n",
" <tr>\n",
" <th></th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>203529 rows \u00d7 2 columns</p>\n",
"</div>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 121,
"text": [
" total_loans \\\n",
"title \n",
"Conduire un v\u00c3\u00a9hicule de promenade / 10016 \n",
"Guide de la route / 8954 \n",
"New York / 7496 \n",
"Cuba / 5233 \n",
"Paris / 4972 \n",
"La grammaire pour tous : 3485 \n",
"L'art de conjuguer : 3443 \n",
"Rome / 3239 \n",
"Costa Rica / 3173 \n",
"Mexique / 3134 \n",
"Portugal / 3105 \n",
"Londres / 2933 \n",
"Math-o-matique : 2903 \n",
"Pour r\u00c3\u00a9ussir math 436 : 2476 \n",
"Tha\u00c3\u00aflande / 2440 \n",
"Barcelone / 2378 \n",
"Vietnam / 2373 \n",
"Turquie / 2358 \n",
"Italie / 2349 \n",
"Maroc / 2283 \n",
"Chine / 2271 \n",
"Floride / 2249 \n",
"Le dessin de manga. 2217 \n",
"Le secret / 2211 \n",
"Espagne / 2186 \n",
"Mange, prie, aime : 2091 \n",
"Venise / 2050 \n",
"La vie comme je l'aime. 1977 \n",
"Conduire un v\u00c3\u00a9hicule lourd / 1958 \n",
"Californie / 1895 \n",
"Ma grammaire / 1879 \n",
"Oeuvres compl\u00c3\u00a8tes / 1871 \n",
"Croatie / 1831 \n",
"Parce qu'on a tous de la visite-- : 1809 \n",
"L'orthographe pour tous : 1804 \n",
"Prague / 1701 \n",
"Provence / 1693 \n",
"Oeuvres / 1677 \n",
"Argentine / 1663 \n",
"Pasta et cetera \u00c3\u00a0 la di Stasio : 1636 \n",
"Canada / 1605 \n",
"Comment j'ai vaincu la douleur et l'inflammation chronique par l'alimentation / 1514 \n",
"Chagrin d'\u00c3\u00a9cole / 1512 \n",
"Inde / 1510 \n",
"France / 1491 \n",
"P\u00c3\u00a9rou / 1461 \n",
"Japon / 1440 \n",
"Boston / 1434 \n",
"Qu\u00c3\u00a9bec / 1432 \n",
"Histoire populaire du Qu\u00c3\u00a9bec / 1381 \n",
"Corse / 1358 \n",
"Janine Sutto : 1354 \n",
"Berlin / 1347 \n",
"Cuisiner avec les aliments contre le cancer / 1343 \n",
"Irlande / 1320 \n",
"Andalousie / 1298 \n",
"Entre cuisine et quincaillerie / 1293 \n",
"Le fran\u00c3\u00a7ais au bureau / 1260 \n",
"Le meilleur de soi / 1245 \n",
"Nouvelle-Angleterre / 1241 \n",
" ... \n",
"\n",
" year_loans \n",
"title \n",
"Conduire un v\u00c3\u00a9hicule de promenade / 418 \n",
"Guide de la route / 453 \n",
"New York / 1084 \n",
"Cuba / 440 \n",
"Paris / 582 \n",
"La grammaire pour tous : 218 \n",
"L'art de conjuguer : 286 \n",
"Rome / 502 \n",
"Costa Rica / 228 \n",
"Mexique / 284 \n",
"Portugal / 365 \n",
"Londres / 472 \n",
"Math-o-matique : 188 \n",
"Pour r\u00c3\u00a9ussir math 436 : 194 \n",
"Tha\u00c3\u00aflande / 288 \n",
"Barcelone / 304 \n",
"Vietnam / 197 \n",
"Turquie / 361 \n",
"Italie / 247 \n",
"Maroc / 386 \n",
"Chine / 309 \n",
"Floride / 211 \n",
"Le dessin de manga. 202 \n",
"Le secret / 107 \n",
"Espagne / 250 \n",
"Mange, prie, aime : 61 \n",
"Venise / 414 \n",
"La vie comme je l'aime. 246 \n",
"Conduire un v\u00c3\u00a9hicule lourd / 159 \n",
"Californie / 250 \n",
"Ma grammaire / 156 \n",
"Oeuvres compl\u00c3\u00a8tes / 313 \n",
"Croatie / 280 \n",
"Parce qu'on a tous de la visite-- : 87 \n",
"L'orthographe pour tous : 188 \n",
"Prague / 272 \n",
"Provence / 276 \n",
"Oeuvres / 249 \n",
"Argentine / 229 \n",
"Pasta et cetera \u00c3\u00a0 la di Stasio : 73 \n",
"Canada / 341 \n",
"Comment j'ai vaincu la douleur et l'inflammation chronique par l'alimentation / 87 \n",
"Chagrin d'\u00c3\u00a9cole / 93 \n",
"Inde / 193 \n",
"France / 180 \n",
"P\u00c3\u00a9rou / 203 \n",
"Japon / 189 \n",
"Boston / 265 \n",
"Qu\u00c3\u00a9bec / 304 \n",
"Histoire populaire du Qu\u00c3\u00a9bec / 199 \n",
"Corse / 263 \n",
"Janine Sutto : 144 \n",
"Berlin / 213 \n",
"Cuisiner avec les aliments contre le cancer / 104 \n",
"Irlande / 283 \n",
"Andalousie / 195 \n",
"Entre cuisine et quincaillerie / 77 \n",
"Le fran\u00c3\u00a7ais au bureau / 93 \n",
"Le meilleur de soi / 79 \n",
"Nouvelle-Angleterre / 254 \n",
" ... \n",
"\n",
"[203529 rows x 2 columns]"
]
}
],
"prompt_number": 121
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"English non-fiction"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"eng_non_fiction = data[(data.type == 'LV_Documentaire A' ) & (data.language == 'eng')]\n",
"eng_nf_counts = eng_non_fiction.groupby(['title'])\n",
"eng_nf_counts.aggregate(np.sum).sort('total_loans', ascending=False)"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>total_loans</th>\n",
" <th>year_loans</th>\n",
" </tr>\n",
" <tr>\n",
" <th>title</th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Driving a passenger vehicle /</th>\n",
" <td> 3490</td>\n",
" <td> 189</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Driver's handbook /</th>\n",
" <td> 2960</td>\n",
" <td> 195</td>\n",
" </tr>\n",
" <tr>\n",
" <th>National Geographic traveler.</th>\n",
" <td> 2448</td>\n",
" <td> 429</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The secret /</th>\n",
" <td> 768</td>\n",
" <td> 52</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Driving a heavy vehicle /</th>\n",
" <td> 755</td>\n",
" <td> 105</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Eat, pray, love :</th>\n",
" <td> 708</td>\n",
" <td> 27</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Bilingual visual dictionary.</th>\n",
" <td> 669</td>\n",
" <td> 70</td>\n",
" </tr>\n",
" <tr>\n",
" <th>A new earth :</th>\n",
" <td> 652</td>\n",
" <td> 41</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The voice of Egypt :</th>\n",
" <td> 649</td>\n",
" <td> 2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Master the basics.</th>\n",
" <td> 506</td>\n",
" <td> 30</td>\n",
" </tr>\n",
" <tr>\n",
" <th>New french with ease</th>\n",
" <td> 505</td>\n",
" <td> 38</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Oprah :</th>\n",
" <td> 475</td>\n",
" <td> 38</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Outliers :</th>\n",
" <td> 470</td>\n",
" <td> 23</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The shock doctrine :</th>\n",
" <td> 466</td>\n",
" <td> 28</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Intermediate English grammar /</th>\n",
" <td> 416</td>\n",
" <td> 16</td>\n",
" </tr>\n",
" <tr>\n",
" <th>New England /</th>\n",
" <td> 407</td>\n",
" <td> 87</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Real life :</th>\n",
" <td> 397</td>\n",
" <td> 42</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The everything French grammar book :</th>\n",
" <td> 394</td>\n",
" <td> 18</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Chicken soup for the soul :</th>\n",
" <td> 391</td>\n",
" <td> 94</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Moon handbooks.</th>\n",
" <td> 389</td>\n",
" <td> 119</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Blink :</th>\n",
" <td> 376</td>\n",
" <td> 20</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Steve Jobs /</th>\n",
" <td> 370</td>\n",
" <td> 51</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Cook with Jamie :</th>\n",
" <td> 367</td>\n",
" <td> 22</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Painless French /</th>\n",
" <td> 355</td>\n",
" <td> 33</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Canada :</th>\n",
" <td> 348</td>\n",
" <td> 72</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Scott 2013 standard postage stamp catalogue /</th>\n",
" <td> 345</td>\n",
" <td> 73</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Elementary English grammar /</th>\n",
" <td> 333</td>\n",
" <td> 18</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Committed :</th>\n",
" <td> 323</td>\n",
" <td> 27</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Florida /</th>\n",
" <td> 314</td>\n",
" <td> 30</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Halloween :</th>\n",
" <td> 305</td>\n",
" <td> 51</td>\n",
" </tr>\n",
" <tr>\n",
" <th>How to prepare for the TOEFL test :</th>\n",
" <td> 303</td>\n",
" <td> 34</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Life :</th>\n",
" <td> 301</td>\n",
" <td> 33</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Fifty shades.</th>\n",
" <td> 300</td>\n",
" <td> 30</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Time out.</th>\n",
" <td> 299</td>\n",
" <td> 29</td>\n",
" </tr>\n",
" <tr>\n",
" <th>O's guide to life :</th>\n",
" <td> 294</td>\n",
" <td> 29</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Argentina /</th>\n",
" <td> 287</td>\n",
" <td> 42</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Jamie's food revolution :</th>\n",
" <td> 284</td>\n",
" <td> 17</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Infidel /</th>\n",
" <td> 282</td>\n",
" <td> 18</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The complete idiot's guide to French verbs /</th>\n",
" <td> 281</td>\n",
" <td> 26</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Italy /</th>\n",
" <td> 276</td>\n",
" <td> 66</td>\n",
" </tr>\n",
" <tr>\n",
" <th>God is not great :</th>\n",
" <td> 272</td>\n",
" <td> 25</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The power of now :</th>\n",
" <td> 271</td>\n",
" <td> 15</td>\n",
" </tr>\n",
" <tr>\n",
" <th>O's big book of happiness :</th>\n",
" <td> 268</td>\n",
" <td> 27</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Teach yourself visually Excel 2007 /</th>\n",
" <td> 266</td>\n",
" <td> 9</td>\n",
" </tr>\n",
" <tr>\n",
" <th>India /</th>\n",
" <td> 259</td>\n",
" <td> 37</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Scott 2011 standard postage stamp catalogue /</th>\n",
" <td> 259</td>\n",
" <td> 57</td>\n",
" </tr>\n",
" <tr>\n",
" <th>A long way gone :</th>\n",
" <td> 256</td>\n",
" <td> 21</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Spain /</th>\n",
" <td> 253</td>\n",
" <td> 51</td>\n",
" </tr>\n",
" <tr>\n",
" <th>French grammar /</th>\n",
" <td> 253</td>\n",
" <td> 9</td>\n",
" </tr>\n",
" <tr>\n",
" <th>What to expect when you're expecting /</th>\n",
" <td> 253</td>\n",
" <td> 16</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Time Out.</th>\n",
" <td> 248</td>\n",
" <td> 46</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The book of secrets :</th>\n",
" <td> 246</td>\n",
" <td> 13</td>\n",
" </tr>\n",
" <tr>\n",
" <th>My life /</th>\n",
" <td> 246</td>\n",
" <td> 35</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The God delusion /</th>\n",
" <td> 244</td>\n",
" <td> 25</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The complete idiot's guide to learning French /</th>\n",
" <td> 242</td>\n",
" <td> 14</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The glass castle :</th>\n",
" <td> 241</td>\n",
" <td> 9</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Life /</th>\n",
" <td> 239</td>\n",
" <td> 31</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Smart shopping Montreal /</th>\n",
" <td> 238</td>\n",
" <td> 32</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Great answers! great questions! :</th>\n",
" <td> 234</td>\n",
" <td> 24</td>\n",
" </tr>\n",
" <tr>\n",
" <th>The pregnancy bible :</th>\n",
" <td> 234</td>\n",
" <td> 19</td>\n",
" </tr>\n",
" <tr>\n",
" <th></th>\n",
" <td>...</td>\n",
" <td>...</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>104613 rows \u00d7 2 columns</p>\n",
"</div>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 120,
"text": [
" total_loans year_loans\n",
"title \n",
"Driving a passenger vehicle / 3490 189\n",
"Driver's handbook / 2960 195\n",
"National Geographic traveler. 2448 429\n",
"The secret / 768 52\n",
"Driving a heavy vehicle / 755 105\n",
"Eat, pray, love : 708 27\n",
"Bilingual visual dictionary. 669 70\n",
"A new earth : 652 41\n",
"The voice of Egypt : 649 2\n",
"Master the basics. 506 30\n",
"New french with ease 505 38\n",
"Oprah : 475 38\n",
"Outliers : 470 23\n",
"The shock doctrine : 466 28\n",
"Intermediate English grammar / 416 16\n",
"New England / 407 87\n",
"Real life : 397 42\n",
"The everything French grammar book : 394 18\n",
"Chicken soup for the soul : 391 94\n",
"Moon handbooks. 389 119\n",
"Blink : 376 20\n",
"Steve Jobs / 370 51\n",
"Cook with Jamie : 367 22\n",
"Painless French / 355 33\n",
"Canada : 348 72\n",
"Scott 2013 standard postage stamp catalogue / 345 73\n",
"Elementary English grammar / 333 18\n",
"Committed : 323 27\n",
"Florida / 314 30\n",
"Halloween : 305 51\n",
"How to prepare for the TOEFL test : 303 34\n",
"Life : 301 33\n",
"Fifty shades. 300 30\n",
"Time out. 299 29\n",
"O's guide to life : 294 29\n",
"Argentina / 287 42\n",
"Jamie's food revolution : 284 17\n",
"Infidel / 282 18\n",
"The complete idiot's guide to French verbs / 281 26\n",
"Italy / 276 66\n",
"God is not great : 272 25\n",
"The power of now : 271 15\n",
"O's big book of happiness : 268 27\n",
"Teach yourself visually Excel 2007 / 266 9\n",
"India / 259 37\n",
"Scott 2011 standard postage stamp catalogue / 259 57\n",
"A long way gone : 256 21\n",
"Spain / 253 51\n",
"French grammar / 253 9\n",
"What to expect when you're expecting / 253 16\n",
"Time Out. 248 46\n",
"The book of secrets : 246 13\n",
"My life / 246 35\n",
"The God delusion / 244 25\n",
"The complete idiot's guide to learning French / 242 14\n",
"The glass castle : 241 9\n",
"Life / 239 31\n",
"Smart shopping Montreal / 238 32\n",
"Great answers! great questions! : 234 24\n",
"The pregnancy bible : 234 19\n",
" ... ...\n",
"\n",
"[104613 rows x 2 columns]"
]
}
],
"prompt_number": 120
},
{
"cell_type": "heading",
"level": 2,
"metadata": {},
"source": [
"Find the top three most loaned books per borough"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"top_boroughs = data.groupby(['borough','title'])\n",
"df2 = top_boroughs.aggregate(sum).reset_index().sort(['borough','total_loans'],ascending=[True,False]).set_index(['borough'])\n",
"df3 = pd.DataFrame()\n",
"for indx in df2.index.unique():\n",
" df3 = pd.concat([df3, df2.ix[indx].iloc[0:3]])\n",
"df3"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>title</th>\n",
" <th>total_loans</th>\n",
" <th>year_loans</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Ahuntsic - Cartierville</th>\n",
" <td> Naruto.</td>\n",
" <td> 24271</td>\n",
" <td> 1095</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ahuntsic - Cartierville</th>\n",
" <td> Album Garfield.</td>\n",
" <td> 10473</td>\n",
" <td> 453</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ahuntsic - Cartierville</th>\n",
" <td> Winx club.</td>\n",
" <td> 8330</td>\n",
" <td> 368</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Anjou</th>\n",
" <td> Naruto.</td>\n",
" <td> 5867</td>\n",
" <td> 315</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Anjou</th>\n",
" <td> Album Garfield.</td>\n",
" <td> 2921</td>\n",
" <td> 201</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Anjou</th>\n",
" <td> Winx club.</td>\n",
" <td> 2755</td>\n",
" <td> 201</td>\n",
" </tr>\n",
" <tr>\n",
" <th>C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce</th>\n",
" <td> Naruto.</td>\n",
" <td> 17039</td>\n",
" <td> 702</td>\n",
" </tr>\n",
" <tr>\n",
" <th>C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce</th>\n",
" <td> D\u00e9tective Conan.</td>\n",
" <td> 11472</td>\n",
" <td> 471</td>\n",
" </tr>\n",
" <tr>\n",
" <th>C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce</th>\n",
" <td> Album Garfield.</td>\n",
" <td> 11023</td>\n",
" <td> 446</td>\n",
" </tr>\n",
" <tr>\n",
" <th>L'\u00cele Bizard - Sainte-Genevi\u00e8ve</th>\n",
" <td> Album Garfield.</td>\n",
" <td> 3079</td>\n",
" <td> 178</td>\n",
" </tr>\n",
" <tr>\n",
" <th>L'\u00cele Bizard - Sainte-Genevi\u00e8ve</th>\n",
" <td> Les Simpson.</td>\n",
" <td> 1205</td>\n",
" <td> 47</td>\n",
" </tr>\n",
" <tr>\n",
" <th>L'\u00cele Bizard - Sainte-Genevi\u00e8ve</th>\n",
" <td> Les l\u00e9gendaires.</td>\n",
" <td> 857</td>\n",
" <td> 37</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LaSalle</th>\n",
" <td> Naruto.</td>\n",
" <td> 8212</td>\n",
" <td> 1051</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LaSalle</th>\n",
" <td> D\u00e9tective Conan.</td>\n",
" <td> 3232</td>\n",
" <td> 618</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LaSalle</th>\n",
" <td> Yu-Gi-Oh.</td>\n",
" <td> 3124</td>\n",
" <td> 603</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Lachine</th>\n",
" <td> Les l\u00e9gendaires.</td>\n",
" <td> 931</td>\n",
" <td> 86</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Lachine</th>\n",
" <td> M\u00e9moires d'un quartier.</td>\n",
" <td> 840</td>\n",
" <td> 169</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Lachine</th>\n",
" <td> Boule &amp; Bill.</td>\n",
" <td> 735</td>\n",
" <td> 64</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mercier-Hochelaga-Maisonneuve</th>\n",
" <td> Naruto.</td>\n",
" <td> 17779</td>\n",
" <td> 1017</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mercier-Hochelaga-Maisonneuve</th>\n",
" <td> Album Garfield.</td>\n",
" <td> 12373</td>\n",
" <td> 789</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mercier-Hochelaga-Maisonneuve</th>\n",
" <td> Les Simpson.</td>\n",
" <td> 7343</td>\n",
" <td> 463</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Montr\u00e9al-Nord</th>\n",
" <td> Naruto.</td>\n",
" <td> 8516</td>\n",
" <td> 921</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Montr\u00e9al-Nord</th>\n",
" <td> Album Garfield.</td>\n",
" <td> 4115</td>\n",
" <td> 408</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Montr\u00e9al-Nord</th>\n",
" <td> Les Simpson.</td>\n",
" <td> 2691</td>\n",
" <td> 450</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Outremont</th>\n",
" <td> Naruto.</td>\n",
" <td> 2879</td>\n",
" <td> 249</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Outremont</th>\n",
" <td> Caillou.</td>\n",
" <td> 1804</td>\n",
" <td> 113</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Outremont</th>\n",
" <td> Les p'tits diables.</td>\n",
" <td> 1383</td>\n",
" <td> 64</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pierrefonds - Roxboro</th>\n",
" <td> Naruto.</td>\n",
" <td> 7629</td>\n",
" <td> 390</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pierrefonds - Roxboro</th>\n",
" <td> Les l\u00e9gendaires.</td>\n",
" <td> 5459</td>\n",
" <td> 371</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pierrefonds - Roxboro</th>\n",
" <td> Album Garfield.</td>\n",
" <td> 5119</td>\n",
" <td> 176</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Plateau-Mont-Royal</th>\n",
" <td> Naruto.</td>\n",
" <td> 6314</td>\n",
" <td> 207</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Plateau-Mont-Royal</th>\n",
" <td> Album Garfield.</td>\n",
" <td> 4430</td>\n",
" <td> 272</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Plateau-Mont-Royal</th>\n",
" <td> Le tr\u00e9sor du pirate Boom [jeu] </td>\n",
" <td> 3760</td>\n",
" <td> 139</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles</th>\n",
" <td> Naruto.</td>\n",
" <td> 14329</td>\n",
" <td> 682</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles</th>\n",
" <td> One Piece.</td>\n",
" <td> 6571</td>\n",
" <td> 325</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles</th>\n",
" <td> Bleach.</td>\n",
" <td> 5074</td>\n",
" <td> 430</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rosemont - La Petite-Patrie</th>\n",
" <td> Naruto.</td>\n",
" <td> 7446</td>\n",
" <td> 753</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rosemont - La Petite-Patrie</th>\n",
" <td> One Piece.</td>\n",
" <td> 7179</td>\n",
" <td> 622</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rosemont - La Petite-Patrie</th>\n",
" <td> Album Garfield.</td>\n",
" <td> 6985</td>\n",
" <td> 469</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-Laurent</th>\n",
" <td> Winx club.</td>\n",
" <td> 4455</td>\n",
" <td> 417</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-Laurent</th>\n",
" <td> D\u00e9tective Conan.</td>\n",
" <td> 3551</td>\n",
" <td> 168</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-Laurent</th>\n",
" <td> Album Garfield.</td>\n",
" <td> 3078</td>\n",
" <td> 138</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-L\u00e9onard</th>\n",
" <td> Naruto.</td>\n",
" <td> 3999</td>\n",
" <td> 232</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-L\u00e9onard</th>\n",
" <td> Album Garfield.</td>\n",
" <td> 2203</td>\n",
" <td> 192</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-L\u00e9onard</th>\n",
" <td> Paris Match [Saint-L\u00e9onard]</td>\n",
" <td> 1653</td>\n",
" <td> 797</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sans Arroundissement</th>\n",
" <td> Naruto.</td>\n",
" <td> 1376</td>\n",
" <td> 265</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sans Arroundissement</th>\n",
" <td> Album Garfield.</td>\n",
" <td> 1351</td>\n",
" <td> 122</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sans Arroundissement</th>\n",
" <td> Le Lundi [Biblio-courrier]</td>\n",
" <td> 984</td>\n",
" <td> 583</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sud-Ouest</th>\n",
" <td> Naruto.</td>\n",
" <td> 10227</td>\n",
" <td> 786</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sud-Ouest</th>\n",
" <td> Album Garfield.</td>\n",
" <td> 6310</td>\n",
" <td> 398</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sud-Ouest</th>\n",
" <td> D\u00e9tective Conan.</td>\n",
" <td> 4978</td>\n",
" <td> 384</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Verdun</th>\n",
" <td> Les l\u00e9gendaires.</td>\n",
" <td> 1879</td>\n",
" <td> 164</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Verdun</th>\n",
" <td> Winx club.</td>\n",
" <td> 1514</td>\n",
" <td> 203</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Verdun</th>\n",
" <td> Nelson.</td>\n",
" <td> 1396</td>\n",
" <td> 102</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ville-Marie</th>\n",
" <td> Naruto.</td>\n",
" <td> 8571</td>\n",
" <td> 456</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ville-Marie</th>\n",
" <td> Yu-Gi-Oh.</td>\n",
" <td> 2757</td>\n",
" <td> 116</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ville-Marie</th>\n",
" <td> Inu Yasha.</td>\n",
" <td> 2257</td>\n",
" <td> 154</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Villeray - Saint-Michel - Parc-Extension</th>\n",
" <td> Naruto.</td>\n",
" <td> 18822</td>\n",
" <td> 967</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Villeray - Saint-Michel - Parc-Extension</th>\n",
" <td> Album Garfield.</td>\n",
" <td> 13788</td>\n",
" <td> 454</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Villeray - Saint-Michel - Parc-Extension</th>\n",
" <td> Winx club.</td>\n",
" <td> 10149</td>\n",
" <td> 314</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>60 rows \u00d7 3 columns</p>\n",
"</div>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 58,
"text": [
" title \\\n",
"Ahuntsic - Cartierville Naruto. \n",
"Ahuntsic - Cartierville Album Garfield. \n",
"Ahuntsic - Cartierville Winx club. \n",
"Anjou Naruto. \n",
"Anjou Album Garfield. \n",
"Anjou Winx club. \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce Naruto. \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce D\u00e9tective Conan. \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce Album Garfield. \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve Album Garfield. \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve Les Simpson. \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve Les l\u00e9gendaires. \n",
"LaSalle Naruto. \n",
"LaSalle D\u00e9tective Conan. \n",
"LaSalle Yu-Gi-Oh. \n",
"Lachine Les l\u00e9gendaires. \n",
"Lachine M\u00e9moires d'un quartier. \n",
"Lachine Boule & Bill. \n",
"Mercier-Hochelaga-Maisonneuve Naruto. \n",
"Mercier-Hochelaga-Maisonneuve Album Garfield. \n",
"Mercier-Hochelaga-Maisonneuve Les Simpson. \n",
"Montr\u00e9al-Nord Naruto. \n",
"Montr\u00e9al-Nord Album Garfield. \n",
"Montr\u00e9al-Nord Les Simpson. \n",
"Outremont Naruto. \n",
"Outremont Caillou. \n",
"Outremont Les p'tits diables. \n",
"Pierrefonds - Roxboro Naruto. \n",
"Pierrefonds - Roxboro Les l\u00e9gendaires. \n",
"Pierrefonds - Roxboro Album Garfield. \n",
"Plateau-Mont-Royal Naruto. \n",
"Plateau-Mont-Royal Album Garfield. \n",
"Plateau-Mont-Royal Le tr\u00e9sor du pirate Boom [jeu] \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles Naruto. \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles One Piece. \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles Bleach. \n",
"Rosemont - La Petite-Patrie Naruto. \n",
"Rosemont - La Petite-Patrie One Piece. \n",
"Rosemont - La Petite-Patrie Album Garfield. \n",
"Saint-Laurent Winx club. \n",
"Saint-Laurent D\u00e9tective Conan. \n",
"Saint-Laurent Album Garfield. \n",
"Saint-L\u00e9onard Naruto. \n",
"Saint-L\u00e9onard Album Garfield. \n",
"Saint-L\u00e9onard Paris Match [Saint-L\u00e9onard] \n",
"Sans Arroundissement Naruto. \n",
"Sans Arroundissement Album Garfield. \n",
"Sans Arroundissement Le Lundi [Biblio-courrier] \n",
"Sud-Ouest Naruto. \n",
"Sud-Ouest Album Garfield. \n",
"Sud-Ouest D\u00e9tective Conan. \n",
"Verdun Les l\u00e9gendaires. \n",
"Verdun Winx club. \n",
"Verdun Nelson. \n",
"Ville-Marie Naruto. \n",
"Ville-Marie Yu-Gi-Oh. \n",
"Ville-Marie Inu Yasha. \n",
"Villeray - Saint-Michel - Parc-Extension Naruto. \n",
"Villeray - Saint-Michel - Parc-Extension Album Garfield. \n",
"Villeray - Saint-Michel - Parc-Extension Winx club. \n",
"\n",
" total_loans year_loans \n",
"Ahuntsic - Cartierville 24271 1095 \n",
"Ahuntsic - Cartierville 10473 453 \n",
"Ahuntsic - Cartierville 8330 368 \n",
"Anjou 5867 315 \n",
"Anjou 2921 201 \n",
"Anjou 2755 201 \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce 17039 702 \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce 11472 471 \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce 11023 446 \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve 3079 178 \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve 1205 47 \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve 857 37 \n",
"LaSalle 8212 1051 \n",
"LaSalle 3232 618 \n",
"LaSalle 3124 603 \n",
"Lachine 931 86 \n",
"Lachine 840 169 \n",
"Lachine 735 64 \n",
"Mercier-Hochelaga-Maisonneuve 17779 1017 \n",
"Mercier-Hochelaga-Maisonneuve 12373 789 \n",
"Mercier-Hochelaga-Maisonneuve 7343 463 \n",
"Montr\u00e9al-Nord 8516 921 \n",
"Montr\u00e9al-Nord 4115 408 \n",
"Montr\u00e9al-Nord 2691 450 \n",
"Outremont 2879 249 \n",
"Outremont 1804 113 \n",
"Outremont 1383 64 \n",
"Pierrefonds - Roxboro 7629 390 \n",
"Pierrefonds - Roxboro 5459 371 \n",
"Pierrefonds - Roxboro 5119 176 \n",
"Plateau-Mont-Royal 6314 207 \n",
"Plateau-Mont-Royal 4430 272 \n",
"Plateau-Mont-Royal 3760 139 \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles 14329 682 \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles 6571 325 \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles 5074 430 \n",
"Rosemont - La Petite-Patrie 7446 753 \n",
"Rosemont - La Petite-Patrie 7179 622 \n",
"Rosemont - La Petite-Patrie 6985 469 \n",
"Saint-Laurent 4455 417 \n",
"Saint-Laurent 3551 168 \n",
"Saint-Laurent 3078 138 \n",
"Saint-L\u00e9onard 3999 232 \n",
"Saint-L\u00e9onard 2203 192 \n",
"Saint-L\u00e9onard 1653 797 \n",
"Sans Arroundissement 1376 265 \n",
"Sans Arroundissement 1351 122 \n",
"Sans Arroundissement 984 583 \n",
"Sud-Ouest 10227 786 \n",
"Sud-Ouest 6310 398 \n",
"Sud-Ouest 4978 384 \n",
"Verdun 1879 164 \n",
"Verdun 1514 203 \n",
"Verdun 1396 102 \n",
"Ville-Marie 8571 456 \n",
"Ville-Marie 2757 116 \n",
"Ville-Marie 2257 154 \n",
"Villeray - Saint-Michel - Parc-Extension 18822 967 \n",
"Villeray - Saint-Michel - Parc-Extension 13788 454 \n",
"Villeray - Saint-Michel - Parc-Extension 10149 314 \n",
"\n",
"[60 rows x 3 columns]"
]
}
],
"prompt_number": 58
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"English fiction"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"top_eng = eng_fiction.groupby(['borough','title'])\n",
"df2 = top_eng.aggregate(sum).reset_index().sort(['borough','total_loans'],ascending=[True,False]).set_index(['borough'])\n",
"df3 = pd.DataFrame()\n",
"for indx in df2.index.unique():\n",
" df3 = pd.concat([df3, df2.ix[indx].iloc[0:3]])\n",
"df3"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>title</th>\n",
" <th>total_loans</th>\n",
" <th>year_loans</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Ahuntsic - Cartierville</th>\n",
" <td> Millennium.</td>\n",
" <td> 267</td>\n",
" <td> 5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ahuntsic - Cartierville</th>\n",
" <td> Fifty shades.</td>\n",
" <td> 213</td>\n",
" <td> 19</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ahuntsic - Cartierville</th>\n",
" <td> Harry Potter and the deathly hallows /</td>\n",
" <td> 152</td>\n",
" <td> 9</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Anjou</th>\n",
" <td> Fifty shades.</td>\n",
" <td> 164</td>\n",
" <td> 12</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Anjou</th>\n",
" <td> Tabous : roman</td>\n",
" <td> 81</td>\n",
" <td> 11</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Anjou</th>\n",
" <td> Millennium.</td>\n",
" <td> 77</td>\n",
" <td> 6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce</th>\n",
" <td> Millennium.</td>\n",
" <td> 631</td>\n",
" <td> 30</td>\n",
" </tr>\n",
" <tr>\n",
" <th>C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce</th>\n",
" <td> A song of ice and fire.</td>\n",
" <td> 338</td>\n",
" <td> 24</td>\n",
" </tr>\n",
" <tr>\n",
" <th>C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce</th>\n",
" <td> The road /</td>\n",
" <td> 259</td>\n",
" <td> 16</td>\n",
" </tr>\n",
" <tr>\n",
" <th>L'\u00cele Bizard - Sainte-Genevi\u00e8ve</th>\n",
" <td> Percy Jackson &amp; the Olympians.</td>\n",
" <td> 119</td>\n",
" <td> 8</td>\n",
" </tr>\n",
" <tr>\n",
" <th>L'\u00cele Bizard - Sainte-Genevi\u00e8ve</th>\n",
" <td> A song of ice and fire.</td>\n",
" <td> 58</td>\n",
" <td> 10</td>\n",
" </tr>\n",
" <tr>\n",
" <th>L'\u00cele Bizard - Sainte-Genevi\u00e8ve</th>\n",
" <td> Inheritance.</td>\n",
" <td> 49</td>\n",
" <td> 15</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LaSalle</th>\n",
" <td> Naruto.</td>\n",
" <td> 1223</td>\n",
" <td> 204</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LaSalle</th>\n",
" <td> Fifty shades.</td>\n",
" <td> 380</td>\n",
" <td> 43</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LaSalle</th>\n",
" <td> The walking dead.</td>\n",
" <td> 302</td>\n",
" <td> 51</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Lachine</th>\n",
" <td> Diary of a wimpy kid.</td>\n",
" <td> 169</td>\n",
" <td> 13</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Lachine</th>\n",
" <td> The walking dead.</td>\n",
" <td> 165</td>\n",
" <td> 16</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Lachine</th>\n",
" <td> Fifty shades.</td>\n",
" <td> 75</td>\n",
" <td> 11</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mercier-Hochelaga-Maisonneuve</th>\n",
" <td> The overlook :</td>\n",
" <td> 123</td>\n",
" <td> 2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mercier-Hochelaga-Maisonneuve</th>\n",
" <td> Millennium.</td>\n",
" <td> 98</td>\n",
" <td> 9</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mercier-Hochelaga-Maisonneuve</th>\n",
" <td> Tribute /</td>\n",
" <td> 91</td>\n",
" <td> 4</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Montr\u00e9al-Nord</th>\n",
" <td> Fifty shades.</td>\n",
" <td> 69</td>\n",
" <td> 11</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Montr\u00e9al-Nord</th>\n",
" <td> A song of ice and fire.</td>\n",
" <td> 51</td>\n",
" <td> 10</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Montr\u00e9al-Nord</th>\n",
" <td> Midori days. 2</td>\n",
" <td> 39</td>\n",
" <td> 5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Outremont</th>\n",
" <td> A song of ice and fire.</td>\n",
" <td> 87</td>\n",
" <td> 13</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Outremont</th>\n",
" <td> Millennium.</td>\n",
" <td> 73</td>\n",
" <td> 11</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Outremont</th>\n",
" <td> [The wheel of time.</td>\n",
" <td> 72</td>\n",
" <td> 5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pierrefonds - Roxboro</th>\n",
" <td> Millennium.</td>\n",
" <td> 325</td>\n",
" <td> 22</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pierrefonds - Roxboro</th>\n",
" <td> Three complete novels :</td>\n",
" <td> 280</td>\n",
" <td> 23</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pierrefonds - Roxboro</th>\n",
" <td> Bakuman.</td>\n",
" <td> 251</td>\n",
" <td> 65</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Plateau-Mont-Royal</th>\n",
" <td> Millennium.</td>\n",
" <td> 144</td>\n",
" <td> 8</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Plateau-Mont-Royal</th>\n",
" <td> The man who smiled /</td>\n",
" <td> 100</td>\n",
" <td> 3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Plateau-Mont-Royal</th>\n",
" <td> Remember me? /</td>\n",
" <td> 92</td>\n",
" <td> 5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles</th>\n",
" <td> Tabous : roman</td>\n",
" <td> 119</td>\n",
" <td> 7</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles</th>\n",
" <td> Fifty shades.</td>\n",
" <td> 93</td>\n",
" <td> 3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles</th>\n",
" <td> Millennium.</td>\n",
" <td> 83</td>\n",
" <td> 7</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rosemont - La Petite-Patrie</th>\n",
" <td> Millennium.</td>\n",
" <td> 150</td>\n",
" <td> 10</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rosemont - La Petite-Patrie</th>\n",
" <td> The lost symbol :</td>\n",
" <td> 67</td>\n",
" <td> 3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rosemont - La Petite-Patrie</th>\n",
" <td> The drop :</td>\n",
" <td> 60</td>\n",
" <td> 5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-Laurent</th>\n",
" <td> Batman :</td>\n",
" <td> 493</td>\n",
" <td> 71</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-Laurent</th>\n",
" <td> Fifty shades.</td>\n",
" <td> 255</td>\n",
" <td> 45</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-Laurent</th>\n",
" <td> Superman :</td>\n",
" <td> 188</td>\n",
" <td> 36</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-L\u00e9onard</th>\n",
" <td> Fifty shades.</td>\n",
" <td> 82</td>\n",
" <td> 9</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-L\u00e9onard</th>\n",
" <td> Private :</td>\n",
" <td> 53</td>\n",
" <td> 16</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-L\u00e9onard</th>\n",
" <td> The help /</td>\n",
" <td> 51</td>\n",
" <td> 6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sans Arroundissement</th>\n",
" <td> Black Hills /</td>\n",
" <td> 24</td>\n",
" <td> 5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sans Arroundissement</th>\n",
" <td> Deeply Odd /</td>\n",
" <td> 22</td>\n",
" <td> 18</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sans Arroundissement</th>\n",
" <td> Millennium.</td>\n",
" <td> 16</td>\n",
" <td> 3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sud-Ouest</th>\n",
" <td> Millennium.</td>\n",
" <td> 302</td>\n",
" <td> 18</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sud-Ouest</th>\n",
" <td> Inubaka, Crazy for dogs.</td>\n",
" <td> 211</td>\n",
" <td> 24</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sud-Ouest</th>\n",
" <td> Fifty shades.</td>\n",
" <td> 150</td>\n",
" <td> 13</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Verdun</th>\n",
" <td> Fifty shades.</td>\n",
" <td> 111</td>\n",
" <td> 5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Verdun</th>\n",
" <td> A song of ice and fire.</td>\n",
" <td> 98</td>\n",
" <td> 15</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Verdun</th>\n",
" <td> Millennium.</td>\n",
" <td> 83</td>\n",
" <td> 12</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ville-Marie</th>\n",
" <td> Rozen maiden.</td>\n",
" <td> 43</td>\n",
" <td> 2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ville-Marie</th>\n",
" <td> Aie woze djoking /</td>\n",
" <td> 29</td>\n",
" <td> 0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ville-Marie</th>\n",
" <td> Invisible /</td>\n",
" <td> 28</td>\n",
" <td> 3</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Villeray - Saint-Michel - Parc-Extension</th>\n",
" <td> Millennium.</td>\n",
" <td> 353</td>\n",
" <td> 18</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Villeray - Saint-Michel - Parc-Extension</th>\n",
" <td> Fifty shades.</td>\n",
" <td> 187</td>\n",
" <td> 20</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Villeray - Saint-Michel - Parc-Extension</th>\n",
" <td> The road /</td>\n",
" <td> 108</td>\n",
" <td> 2</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>60 rows \u00d7 3 columns</p>\n",
"</div>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 63,
"text": [
" title \\\n",
"Ahuntsic - Cartierville Millennium. \n",
"Ahuntsic - Cartierville Fifty shades. \n",
"Ahuntsic - Cartierville Harry Potter and the deathly hallows / \n",
"Anjou Fifty shades. \n",
"Anjou Tabous : roman \n",
"Anjou Millennium. \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce Millennium. \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce A song of ice and fire. \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce The road / \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve Percy Jackson & the Olympians. \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve A song of ice and fire. \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve Inheritance. \n",
"LaSalle Naruto. \n",
"LaSalle Fifty shades. \n",
"LaSalle The walking dead. \n",
"Lachine Diary of a wimpy kid. \n",
"Lachine The walking dead. \n",
"Lachine Fifty shades. \n",
"Mercier-Hochelaga-Maisonneuve The overlook : \n",
"Mercier-Hochelaga-Maisonneuve Millennium. \n",
"Mercier-Hochelaga-Maisonneuve Tribute / \n",
"Montr\u00e9al-Nord Fifty shades. \n",
"Montr\u00e9al-Nord A song of ice and fire. \n",
"Montr\u00e9al-Nord Midori days. 2 \n",
"Outremont A song of ice and fire. \n",
"Outremont Millennium. \n",
"Outremont [The wheel of time. \n",
"Pierrefonds - Roxboro Millennium. \n",
"Pierrefonds - Roxboro Three complete novels : \n",
"Pierrefonds - Roxboro Bakuman. \n",
"Plateau-Mont-Royal Millennium. \n",
"Plateau-Mont-Royal The man who smiled / \n",
"Plateau-Mont-Royal Remember me? / \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles Tabous : roman \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles Fifty shades. \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles Millennium. \n",
"Rosemont - La Petite-Patrie Millennium. \n",
"Rosemont - La Petite-Patrie The lost symbol : \n",
"Rosemont - La Petite-Patrie The drop : \n",
"Saint-Laurent Batman : \n",
"Saint-Laurent Fifty shades. \n",
"Saint-Laurent Superman : \n",
"Saint-L\u00e9onard Fifty shades. \n",
"Saint-L\u00e9onard Private : \n",
"Saint-L\u00e9onard The help / \n",
"Sans Arroundissement Black Hills / \n",
"Sans Arroundissement Deeply Odd / \n",
"Sans Arroundissement Millennium. \n",
"Sud-Ouest Millennium. \n",
"Sud-Ouest Inubaka, Crazy for dogs. \n",
"Sud-Ouest Fifty shades. \n",
"Verdun Fifty shades. \n",
"Verdun A song of ice and fire. \n",
"Verdun Millennium. \n",
"Ville-Marie Rozen maiden. \n",
"Ville-Marie Aie woze djoking / \n",
"Ville-Marie Invisible / \n",
"Villeray - Saint-Michel - Parc-Extension Millennium. \n",
"Villeray - Saint-Michel - Parc-Extension Fifty shades. \n",
"Villeray - Saint-Michel - Parc-Extension The road / \n",
"\n",
" total_loans year_loans \n",
"Ahuntsic - Cartierville 267 5 \n",
"Ahuntsic - Cartierville 213 19 \n",
"Ahuntsic - Cartierville 152 9 \n",
"Anjou 164 12 \n",
"Anjou 81 11 \n",
"Anjou 77 6 \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce 631 30 \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce 338 24 \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce 259 16 \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve 119 8 \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve 58 10 \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve 49 15 \n",
"LaSalle 1223 204 \n",
"LaSalle 380 43 \n",
"LaSalle 302 51 \n",
"Lachine 169 13 \n",
"Lachine 165 16 \n",
"Lachine 75 11 \n",
"Mercier-Hochelaga-Maisonneuve 123 2 \n",
"Mercier-Hochelaga-Maisonneuve 98 9 \n",
"Mercier-Hochelaga-Maisonneuve 91 4 \n",
"Montr\u00e9al-Nord 69 11 \n",
"Montr\u00e9al-Nord 51 10 \n",
"Montr\u00e9al-Nord 39 5 \n",
"Outremont 87 13 \n",
"Outremont 73 11 \n",
"Outremont 72 5 \n",
"Pierrefonds - Roxboro 325 22 \n",
"Pierrefonds - Roxboro 280 23 \n",
"Pierrefonds - Roxboro 251 65 \n",
"Plateau-Mont-Royal 144 8 \n",
"Plateau-Mont-Royal 100 3 \n",
"Plateau-Mont-Royal 92 5 \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles 119 7 \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles 93 3 \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles 83 7 \n",
"Rosemont - La Petite-Patrie 150 10 \n",
"Rosemont - La Petite-Patrie 67 3 \n",
"Rosemont - La Petite-Patrie 60 5 \n",
"Saint-Laurent 493 71 \n",
"Saint-Laurent 255 45 \n",
"Saint-Laurent 188 36 \n",
"Saint-L\u00e9onard 82 9 \n",
"Saint-L\u00e9onard 53 16 \n",
"Saint-L\u00e9onard 51 6 \n",
"Sans Arroundissement 24 5 \n",
"Sans Arroundissement 22 18 \n",
"Sans Arroundissement 16 3 \n",
"Sud-Ouest 302 18 \n",
"Sud-Ouest 211 24 \n",
"Sud-Ouest 150 13 \n",
"Verdun 111 5 \n",
"Verdun 98 15 \n",
"Verdun 83 12 \n",
"Ville-Marie 43 2 \n",
"Ville-Marie 29 0 \n",
"Ville-Marie 28 3 \n",
"Villeray - Saint-Michel - Parc-Extension 353 18 \n",
"Villeray - Saint-Michel - Parc-Extension 187 20 \n",
"Villeray - Saint-Michel - Parc-Extension 108 2 \n",
"\n",
"[60 rows x 3 columns]"
]
}
],
"prompt_number": 63
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"French fiction"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"top_fre = fre_fiction.groupby(['borough','title'])\n",
"df2 = top_fre.aggregate(sum).reset_index().sort(['borough','total_loans'],ascending=[True,False]).set_index(['borough'])\n",
"df3 = pd.DataFrame()\n",
"for indx in df2.index.unique():\n",
" df3 = pd.concat([df3, df2.ix[indx].iloc[0:3]])\n",
"df3"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>title</th>\n",
" <th>total_loans</th>\n",
" <th>year_loans</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Ahuntsic - Cartierville</th>\n",
" <td> M\u00e9moires d'un quartier.</td>\n",
" <td> 2978</td>\n",
" <td> 222</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ahuntsic - Cartierville</th>\n",
" <td> \u00c0 l'ombre du clocher.</td>\n",
" <td> 1526</td>\n",
" <td> 41</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ahuntsic - Cartierville</th>\n",
" <td> Les chevaliers d'\u00c9meraude.</td>\n",
" <td> 1468</td>\n",
" <td> 104</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Anjou</th>\n",
" <td> M\u00e9moires d'un quartier.</td>\n",
" <td> 1185</td>\n",
" <td> 180</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Anjou</th>\n",
" <td> Lieutenant Eve Dallas.</td>\n",
" <td> 852</td>\n",
" <td> 91</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Anjou</th>\n",
" <td> Les ann\u00e9es du silence.</td>\n",
" <td> 634</td>\n",
" <td> 33</td>\n",
" </tr>\n",
" <tr>\n",
" <th>C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce</th>\n",
" <td> L'histoire secr\u00e8te.</td>\n",
" <td> 1262</td>\n",
" <td> 126</td>\n",
" </tr>\n",
" <tr>\n",
" <th>C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce</th>\n",
" <td> La geste des chevaliers dragons.</td>\n",
" <td> 1232</td>\n",
" <td> 107</td>\n",
" </tr>\n",
" <tr>\n",
" <th>C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce</th>\n",
" <td> Trolls de Troy.</td>\n",
" <td> 1228</td>\n",
" <td> 105</td>\n",
" </tr>\n",
" <tr>\n",
" <th>L'\u00cele Bizard - Sainte-Genevi\u00e8ve</th>\n",
" <td> M\u00e9moires d'un quartier.</td>\n",
" <td> 456</td>\n",
" <td> 32</td>\n",
" </tr>\n",
" <tr>\n",
" <th>L'\u00cele Bizard - Sainte-Genevi\u00e8ve</th>\n",
" <td> Les chevaliers d'\u00c9meraude.</td>\n",
" <td> 450</td>\n",
" <td> 49</td>\n",
" </tr>\n",
" <tr>\n",
" <th>L'\u00cele Bizard - Sainte-Genevi\u00e8ve</th>\n",
" <td> \u00c0 l'ombre du clocher.</td>\n",
" <td> 305</td>\n",
" <td> 8</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LaSalle</th>\n",
" <td> Naruto.</td>\n",
" <td> 5697</td>\n",
" <td> 737</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LaSalle</th>\n",
" <td> One Piece.</td>\n",
" <td> 2948</td>\n",
" <td> 541</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LaSalle</th>\n",
" <td> D\u00e9tective Conan.</td>\n",
" <td> 1860</td>\n",
" <td> 501</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Lachine</th>\n",
" <td> M\u00e9moires d'un quartier.</td>\n",
" <td> 840</td>\n",
" <td> 169</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Lachine</th>\n",
" <td> Les nombrils.</td>\n",
" <td> 301</td>\n",
" <td> 17</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Lachine</th>\n",
" <td> Au bord de la rivi\u00e8re.</td>\n",
" <td> 289</td>\n",
" <td> 78</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mercier-Hochelaga-Maisonneuve</th>\n",
" <td> M\u00e9moires d'un quartier.</td>\n",
" <td> 3309</td>\n",
" <td> 246</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mercier-Hochelaga-Maisonneuve</th>\n",
" <td> Lieutenant Eve Dallas.</td>\n",
" <td> 2034</td>\n",
" <td> 121</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mercier-Hochelaga-Maisonneuve</th>\n",
" <td> A.N.G.E.</td>\n",
" <td> 1812</td>\n",
" <td> 93</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Montr\u00e9al-Nord</th>\n",
" <td> Naruto.</td>\n",
" <td> 6956</td>\n",
" <td> 790</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Montr\u00e9al-Nord</th>\n",
" <td> Bleach.</td>\n",
" <td> 1792</td>\n",
" <td> 169</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Montr\u00e9al-Nord</th>\n",
" <td> M\u00e9moires d'un quartier.</td>\n",
" <td> 1530</td>\n",
" <td> 229</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Outremont</th>\n",
" <td> Les psy.</td>\n",
" <td> 492</td>\n",
" <td> 52</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Outremont</th>\n",
" <td> Les naufrag\u00e9s d'Ythaq.</td>\n",
" <td> 457</td>\n",
" <td> 9</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Outremont</th>\n",
" <td> Sillage.</td>\n",
" <td> 426</td>\n",
" <td> 32</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pierrefonds - Roxboro</th>\n",
" <td> M\u00e9moires d'un quartier.</td>\n",
" <td> 1462</td>\n",
" <td> 118</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pierrefonds - Roxboro</th>\n",
" <td> Les chevaliers d'\u00c9meraude.</td>\n",
" <td> 1248</td>\n",
" <td> 62</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pierrefonds - Roxboro</th>\n",
" <td> Le journal d'Aur\u00e9lie Laflamme.</td>\n",
" <td> 1009</td>\n",
" <td> 30</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Plateau-Mont-Royal</th>\n",
" <td> L'histoire secr\u00e8te.</td>\n",
" <td> 1367</td>\n",
" <td> 125</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Plateau-Mont-Royal</th>\n",
" <td> Magasin g\u00e9n\u00e9ral.</td>\n",
" <td> 1079</td>\n",
" <td> 45</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Plateau-Mont-Royal</th>\n",
" <td> Trolls de Troy.</td>\n",
" <td> 1006</td>\n",
" <td> 69</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles</th>\n",
" <td> M\u00e9moires d'un quartier.</td>\n",
" <td> 4566</td>\n",
" <td> 288</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles</th>\n",
" <td> Lieutenant Eve Dallas.</td>\n",
" <td> 1735</td>\n",
" <td> 114</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles</th>\n",
" <td> La poussi\u00e8re du temps.</td>\n",
" <td> 1655</td>\n",
" <td> 36</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rosemont - La Petite-Patrie</th>\n",
" <td> M\u00e9moires d'un quartier.</td>\n",
" <td> 2020</td>\n",
" <td> 243</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rosemont - La Petite-Patrie</th>\n",
" <td> Magasin g\u00e9n\u00e9ral.</td>\n",
" <td> 1479</td>\n",
" <td> 52</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rosemont - La Petite-Patrie</th>\n",
" <td> Walking dead.</td>\n",
" <td> 1214</td>\n",
" <td> 96</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-Laurent</th>\n",
" <td> M\u00e9moires d'un quartier.</td>\n",
" <td> 813</td>\n",
" <td> 96</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-Laurent</th>\n",
" <td> Walking dead.</td>\n",
" <td> 507</td>\n",
" <td> 113</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-Laurent</th>\n",
" <td> L'histoire secr\u00e8te.</td>\n",
" <td> 359</td>\n",
" <td> 96</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-L\u00e9onard</th>\n",
" <td> M\u00e9moires d'un quartier.</td>\n",
" <td> 926</td>\n",
" <td> 36</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-L\u00e9onard</th>\n",
" <td> Un bonheur si fragile.</td>\n",
" <td> 289</td>\n",
" <td> 19</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-L\u00e9onard</th>\n",
" <td> A.N.G.E.</td>\n",
" <td> 267</td>\n",
" <td> 22</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sans Arroundissement</th>\n",
" <td> M\u00e9moires d'un quartier.</td>\n",
" <td> 615</td>\n",
" <td> 118</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sans Arroundissement</th>\n",
" <td> Un bonheur si fragile.</td>\n",
" <td> 295</td>\n",
" <td> 32</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sans Arroundissement</th>\n",
" <td> \u00c0 l'ombre du clocher.</td>\n",
" <td> 287</td>\n",
" <td> 12</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sud-Ouest</th>\n",
" <td> M\u00e9moires d'un quartier.</td>\n",
" <td> 1621</td>\n",
" <td> 131</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sud-Ouest</th>\n",
" <td> Bleach.</td>\n",
" <td> 1149</td>\n",
" <td> 100</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sud-Ouest</th>\n",
" <td> Death note.</td>\n",
" <td> 1091</td>\n",
" <td> 67</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Verdun</th>\n",
" <td> One Piece.</td>\n",
" <td> 826</td>\n",
" <td> 193</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Verdun</th>\n",
" <td> M\u00e9moires d'un quartier.</td>\n",
" <td> 566</td>\n",
" <td> 52</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Verdun</th>\n",
" <td> Les chevaliers d'\u00c9meraude.</td>\n",
" <td> 316</td>\n",
" <td> 47</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ville-Marie</th>\n",
" <td> Samura\u00ef Deeper Ky\u00f4.</td>\n",
" <td> 1155</td>\n",
" <td> 58</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ville-Marie</th>\n",
" <td> M\u00e9moires d'un quartier.</td>\n",
" <td> 1142</td>\n",
" <td> 160</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ville-Marie</th>\n",
" <td> Death note.</td>\n",
" <td> 1038</td>\n",
" <td> 65</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Villeray - Saint-Michel - Parc-Extension</th>\n",
" <td> M\u00e9moires d'un quartier.</td>\n",
" <td> 2199</td>\n",
" <td> 204</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Villeray - Saint-Michel - Parc-Extension</th>\n",
" <td> Magasin g\u00e9n\u00e9ral.</td>\n",
" <td> 1860</td>\n",
" <td> 79</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Villeray - Saint-Michel - Parc-Extension</th>\n",
" <td> L'histoire secr\u00e8te.</td>\n",
" <td> 1695</td>\n",
" <td> 241</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>60 rows \u00d7 3 columns</p>\n",
"</div>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 65,
"text": [
" title \\\n",
"Ahuntsic - Cartierville M\u00e9moires d'un quartier. \n",
"Ahuntsic - Cartierville \u00c0 l'ombre du clocher. \n",
"Ahuntsic - Cartierville Les chevaliers d'\u00c9meraude. \n",
"Anjou M\u00e9moires d'un quartier. \n",
"Anjou Lieutenant Eve Dallas. \n",
"Anjou Les ann\u00e9es du silence. \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce L'histoire secr\u00e8te. \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce La geste des chevaliers dragons. \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce Trolls de Troy. \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve M\u00e9moires d'un quartier. \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve Les chevaliers d'\u00c9meraude. \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve \u00c0 l'ombre du clocher. \n",
"LaSalle Naruto. \n",
"LaSalle One Piece. \n",
"LaSalle D\u00e9tective Conan. \n",
"Lachine M\u00e9moires d'un quartier. \n",
"Lachine Les nombrils. \n",
"Lachine Au bord de la rivi\u00e8re. \n",
"Mercier-Hochelaga-Maisonneuve M\u00e9moires d'un quartier. \n",
"Mercier-Hochelaga-Maisonneuve Lieutenant Eve Dallas. \n",
"Mercier-Hochelaga-Maisonneuve A.N.G.E. \n",
"Montr\u00e9al-Nord Naruto. \n",
"Montr\u00e9al-Nord Bleach. \n",
"Montr\u00e9al-Nord M\u00e9moires d'un quartier. \n",
"Outremont Les psy. \n",
"Outremont Les naufrag\u00e9s d'Ythaq. \n",
"Outremont Sillage. \n",
"Pierrefonds - Roxboro M\u00e9moires d'un quartier. \n",
"Pierrefonds - Roxboro Les chevaliers d'\u00c9meraude. \n",
"Pierrefonds - Roxboro Le journal d'Aur\u00e9lie Laflamme. \n",
"Plateau-Mont-Royal L'histoire secr\u00e8te. \n",
"Plateau-Mont-Royal Magasin g\u00e9n\u00e9ral. \n",
"Plateau-Mont-Royal Trolls de Troy. \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles M\u00e9moires d'un quartier. \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles Lieutenant Eve Dallas. \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles La poussi\u00e8re du temps. \n",
"Rosemont - La Petite-Patrie M\u00e9moires d'un quartier. \n",
"Rosemont - La Petite-Patrie Magasin g\u00e9n\u00e9ral. \n",
"Rosemont - La Petite-Patrie Walking dead. \n",
"Saint-Laurent M\u00e9moires d'un quartier. \n",
"Saint-Laurent Walking dead. \n",
"Saint-Laurent L'histoire secr\u00e8te. \n",
"Saint-L\u00e9onard M\u00e9moires d'un quartier. \n",
"Saint-L\u00e9onard Un bonheur si fragile. \n",
"Saint-L\u00e9onard A.N.G.E. \n",
"Sans Arroundissement M\u00e9moires d'un quartier. \n",
"Sans Arroundissement Un bonheur si fragile. \n",
"Sans Arroundissement \u00c0 l'ombre du clocher. \n",
"Sud-Ouest M\u00e9moires d'un quartier. \n",
"Sud-Ouest Bleach. \n",
"Sud-Ouest Death note. \n",
"Verdun One Piece. \n",
"Verdun M\u00e9moires d'un quartier. \n",
"Verdun Les chevaliers d'\u00c9meraude. \n",
"Ville-Marie Samura\u00ef Deeper Ky\u00f4. \n",
"Ville-Marie M\u00e9moires d'un quartier. \n",
"Ville-Marie Death note. \n",
"Villeray - Saint-Michel - Parc-Extension M\u00e9moires d'un quartier. \n",
"Villeray - Saint-Michel - Parc-Extension Magasin g\u00e9n\u00e9ral. \n",
"Villeray - Saint-Michel - Parc-Extension L'histoire secr\u00e8te. \n",
"\n",
" total_loans year_loans \n",
"Ahuntsic - Cartierville 2978 222 \n",
"Ahuntsic - Cartierville 1526 41 \n",
"Ahuntsic - Cartierville 1468 104 \n",
"Anjou 1185 180 \n",
"Anjou 852 91 \n",
"Anjou 634 33 \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce 1262 126 \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce 1232 107 \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce 1228 105 \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve 456 32 \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve 450 49 \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve 305 8 \n",
"LaSalle 5697 737 \n",
"LaSalle 2948 541 \n",
"LaSalle 1860 501 \n",
"Lachine 840 169 \n",
"Lachine 301 17 \n",
"Lachine 289 78 \n",
"Mercier-Hochelaga-Maisonneuve 3309 246 \n",
"Mercier-Hochelaga-Maisonneuve 2034 121 \n",
"Mercier-Hochelaga-Maisonneuve 1812 93 \n",
"Montr\u00e9al-Nord 6956 790 \n",
"Montr\u00e9al-Nord 1792 169 \n",
"Montr\u00e9al-Nord 1530 229 \n",
"Outremont 492 52 \n",
"Outremont 457 9 \n",
"Outremont 426 32 \n",
"Pierrefonds - Roxboro 1462 118 \n",
"Pierrefonds - Roxboro 1248 62 \n",
"Pierrefonds - Roxboro 1009 30 \n",
"Plateau-Mont-Royal 1367 125 \n",
"Plateau-Mont-Royal 1079 45 \n",
"Plateau-Mont-Royal 1006 69 \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles 4566 288 \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles 1735 114 \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles 1655 36 \n",
"Rosemont - La Petite-Patrie 2020 243 \n",
"Rosemont - La Petite-Patrie 1479 52 \n",
"Rosemont - La Petite-Patrie 1214 96 \n",
"Saint-Laurent 813 96 \n",
"Saint-Laurent 507 113 \n",
"Saint-Laurent 359 96 \n",
"Saint-L\u00e9onard 926 36 \n",
"Saint-L\u00e9onard 289 19 \n",
"Saint-L\u00e9onard 267 22 \n",
"Sans Arroundissement 615 118 \n",
"Sans Arroundissement 295 32 \n",
"Sans Arroundissement 287 12 \n",
"Sud-Ouest 1621 131 \n",
"Sud-Ouest 1149 100 \n",
"Sud-Ouest 1091 67 \n",
"Verdun 826 193 \n",
"Verdun 566 52 \n",
"Verdun 316 47 \n",
"Ville-Marie 1155 58 \n",
"Ville-Marie 1142 160 \n",
"Ville-Marie 1038 65 \n",
"Villeray - Saint-Michel - Parc-Extension 2199 204 \n",
"Villeray - Saint-Michel - Parc-Extension 1860 79 \n",
"Villeray - Saint-Michel - Parc-Extension 1695 241 \n",
"\n",
"[60 rows x 3 columns]"
]
}
],
"prompt_number": 65
},
{
"cell_type": "heading",
"level": 3,
"metadata": {},
"source": [
"Non-fiction"
]
},
{
"cell_type": "code",
"collapsed": false,
"input": [
"non_fic = data[data.type == 'LV_Documentaire A' ]\n",
"top_nf = non_fic.groupby(['borough','title'])\n",
"df2 = top_nf.aggregate(sum).reset_index().sort(['borough','total_loans'],ascending=[True,False]).set_index(['borough'])\n",
"df3 = pd.DataFrame()\n",
"for indx in df2.index.unique():\n",
" df3 = pd.concat([df3, df2.ix[indx].iloc[0:3]])\n",
"df3"
],
"language": "python",
"metadata": {},
"outputs": [
{
"html": [
"<div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>title</th>\n",
" <th>total_loans</th>\n",
" <th>year_loans</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Ahuntsic - Cartierville</th>\n",
" <td> Guide de la route /</td>\n",
" <td> 1418</td>\n",
" <td> 48</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ahuntsic - Cartierville</th>\n",
" <td> Conduire un v\u00e9hicule de promenade /</td>\n",
" <td> 1213</td>\n",
" <td> 37</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ahuntsic - Cartierville</th>\n",
" <td> New York /</td>\n",
" <td> 1161</td>\n",
" <td> 74</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Anjou</th>\n",
" <td> Guide de la route /</td>\n",
" <td> 616</td>\n",
" <td> 38</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Anjou</th>\n",
" <td> Conduire un v\u00e9hicule de promenade /</td>\n",
" <td> 511</td>\n",
" <td> 28</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Anjou</th>\n",
" <td> L'art de conjuguer :</td>\n",
" <td> 184</td>\n",
" <td> 17</td>\n",
" </tr>\n",
" <tr>\n",
" <th>C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce</th>\n",
" <td> Conduire un v\u00e9hicule de promenade /</td>\n",
" <td> 1300</td>\n",
" <td> 31</td>\n",
" </tr>\n",
" <tr>\n",
" <th>C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce</th>\n",
" <td> Driving a passenger vehicle /</td>\n",
" <td> 882</td>\n",
" <td> 18</td>\n",
" </tr>\n",
" <tr>\n",
" <th>C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce</th>\n",
" <td> New York /</td>\n",
" <td> 620</td>\n",
" <td> 101</td>\n",
" </tr>\n",
" <tr>\n",
" <th>L'\u00cele Bizard - Sainte-Genevi\u00e8ve</th>\n",
" <td> Conduire un v\u00e9hicule de promenade /</td>\n",
" <td> 106</td>\n",
" <td> 9</td>\n",
" </tr>\n",
" <tr>\n",
" <th>L'\u00cele Bizard - Sainte-Genevi\u00e8ve</th>\n",
" <td> Paris /</td>\n",
" <td> 100</td>\n",
" <td> 12</td>\n",
" </tr>\n",
" <tr>\n",
" <th>L'\u00cele Bizard - Sainte-Genevi\u00e8ve</th>\n",
" <td> Aux confins de Montr\u00e9al : l'\u00eele Bizard, des or...</td>\n",
" <td> 99</td>\n",
" <td> 11</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LaSalle</th>\n",
" <td> Je cuisine :</td>\n",
" <td> 563</td>\n",
" <td> 77</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LaSalle</th>\n",
" <td> Guide de la route /</td>\n",
" <td> 370</td>\n",
" <td> 16</td>\n",
" </tr>\n",
" <tr>\n",
" <th>LaSalle</th>\n",
" <td> Je d\u00e9core :</td>\n",
" <td> 340</td>\n",
" <td> 86</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Lachine</th>\n",
" <td> Guide de la route /</td>\n",
" <td> 204</td>\n",
" <td> 8</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Lachine</th>\n",
" <td> Conduire un v\u00e9hicule de promenade /</td>\n",
" <td> 127</td>\n",
" <td> 6</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Lachine</th>\n",
" <td> Scott 2013 standard postage stamp catalogue /</td>\n",
" <td> 104</td>\n",
" <td> 0</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mercier-Hochelaga-Maisonneuve</th>\n",
" <td> Cuba /</td>\n",
" <td> 835</td>\n",
" <td> 48</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mercier-Hochelaga-Maisonneuve</th>\n",
" <td> New York /</td>\n",
" <td> 739</td>\n",
" <td> 56</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Mercier-Hochelaga-Maisonneuve</th>\n",
" <td> Guide de la route /</td>\n",
" <td> 677</td>\n",
" <td> 22</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Montr\u00e9al-Nord</th>\n",
" <td> Guide de la route /</td>\n",
" <td> 521</td>\n",
" <td> 16</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Montr\u00e9al-Nord</th>\n",
" <td> Conduire un v\u00e9hicule de promenade /</td>\n",
" <td> 487</td>\n",
" <td> 14</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Montr\u00e9al-Nord</th>\n",
" <td> Math-o-matique :</td>\n",
" <td> 234</td>\n",
" <td> 28</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Outremont</th>\n",
" <td> New York /</td>\n",
" <td> 439</td>\n",
" <td> 38</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Outremont</th>\n",
" <td> Paris /</td>\n",
" <td> 362</td>\n",
" <td> 35</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Outremont</th>\n",
" <td> Portugal /</td>\n",
" <td> 224</td>\n",
" <td> 16</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pierrefonds - Roxboro</th>\n",
" <td> Guide de la route /</td>\n",
" <td> 595</td>\n",
" <td> 20</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pierrefonds - Roxboro</th>\n",
" <td> Conduire un v\u00e9hicule de promenade /</td>\n",
" <td> 563</td>\n",
" <td> 22</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Pierrefonds - Roxboro</th>\n",
" <td> Driver's handbook /</td>\n",
" <td> 495</td>\n",
" <td> 18</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Plateau-Mont-Royal</th>\n",
" <td> New York /</td>\n",
" <td> 605</td>\n",
" <td> 63</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Plateau-Mont-Royal</th>\n",
" <td> Guide de la route /</td>\n",
" <td> 489</td>\n",
" <td> 23</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Plateau-Mont-Royal</th>\n",
" <td> Cuba /</td>\n",
" <td> 424</td>\n",
" <td> 20</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles</th>\n",
" <td> Le dessin de manga.</td>\n",
" <td> 886</td>\n",
" <td> 57</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles</th>\n",
" <td> New York /</td>\n",
" <td> 645</td>\n",
" <td> 67</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles</th>\n",
" <td> Cuba /</td>\n",
" <td> 388</td>\n",
" <td> 36</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rosemont - La Petite-Patrie</th>\n",
" <td> Conduire un v\u00e9hicule de promenade /</td>\n",
" <td> 875</td>\n",
" <td> 34</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rosemont - La Petite-Patrie</th>\n",
" <td> Guide de la route /</td>\n",
" <td> 782</td>\n",
" <td> 63</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Rosemont - La Petite-Patrie</th>\n",
" <td> New York /</td>\n",
" <td> 723</td>\n",
" <td> 113</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-Laurent</th>\n",
" <td> Driver's handbook /</td>\n",
" <td> 394</td>\n",
" <td> 33</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-Laurent</th>\n",
" <td> Conduire un v\u00e9hicule de promenade /</td>\n",
" <td> 351</td>\n",
" <td> 24</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-Laurent</th>\n",
" <td> Paris /</td>\n",
" <td> 336</td>\n",
" <td> 85</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-L\u00e9onard</th>\n",
" <td> L'art de conjuguer :</td>\n",
" <td> 241</td>\n",
" <td> 18</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-L\u00e9onard</th>\n",
" <td> Guide de la route /</td>\n",
" <td> 233</td>\n",
" <td> 21</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Saint-L\u00e9onard</th>\n",
" <td> La grammaire pour tous :</td>\n",
" <td> 174</td>\n",
" <td> 11</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sans Arroundissement</th>\n",
" <td> Y'a des moments si merveilleux--\" :\"</td>\n",
" <td> 52</td>\n",
" <td> 5</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sans Arroundissement</th>\n",
" <td> L'\u00e9nigmatique C\u00e9line Dion :</td>\n",
" <td> 49</td>\n",
" <td> 2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sans Arroundissement</th>\n",
" <td> Th\u00e9r\u00e8se Dion :</td>\n",
" <td> 47</td>\n",
" <td> 2</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sud-Ouest</th>\n",
" <td> Conduire un v\u00e9hicule de promenade /</td>\n",
" <td> 583</td>\n",
" <td> 33</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sud-Ouest</th>\n",
" <td> Guide de la route /</td>\n",
" <td> 316</td>\n",
" <td> 16</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Sud-Ouest</th>\n",
" <td> New York /</td>\n",
" <td> 293</td>\n",
" <td> 33</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Verdun</th>\n",
" <td> Conduire un v\u00e9hicule de promenade /</td>\n",
" <td> 279</td>\n",
" <td> 25</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Verdun</th>\n",
" <td> New York /</td>\n",
" <td> 205</td>\n",
" <td> 61</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Verdun</th>\n",
" <td> Guide de la route /</td>\n",
" <td> 168</td>\n",
" <td> 13</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ville-Marie</th>\n",
" <td> New York /</td>\n",
" <td> 273</td>\n",
" <td> 41</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ville-Marie</th>\n",
" <td> Conduire un v\u00e9hicule de promenade /</td>\n",
" <td> 244</td>\n",
" <td> 20</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Ville-Marie</th>\n",
" <td> Guide de la route /</td>\n",
" <td> 204</td>\n",
" <td> 10</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Villeray - Saint-Michel - Parc-Extension</th>\n",
" <td> Conduire un v\u00e9hicule de promenade /</td>\n",
" <td> 1733</td>\n",
" <td> 66</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Villeray - Saint-Michel - Parc-Extension</th>\n",
" <td> Guide de la route /</td>\n",
" <td> 1416</td>\n",
" <td> 68</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Villeray - Saint-Michel - Parc-Extension</th>\n",
" <td> La grammaire pour tous :</td>\n",
" <td> 628</td>\n",
" <td> 16</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>60 rows \u00d7 3 columns</p>\n",
"</div>"
],
"metadata": {},
"output_type": "pyout",
"prompt_number": 66,
"text": [
" title \\\n",
"Ahuntsic - Cartierville Guide de la route / \n",
"Ahuntsic - Cartierville Conduire un v\u00e9hicule de promenade / \n",
"Ahuntsic - Cartierville New York / \n",
"Anjou Guide de la route / \n",
"Anjou Conduire un v\u00e9hicule de promenade / \n",
"Anjou L'art de conjuguer : \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce Conduire un v\u00e9hicule de promenade / \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce Driving a passenger vehicle / \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce New York / \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve Conduire un v\u00e9hicule de promenade / \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve Paris / \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve Aux confins de Montr\u00e9al : l'\u00eele Bizard, des or... \n",
"LaSalle Je cuisine : \n",
"LaSalle Guide de la route / \n",
"LaSalle Je d\u00e9core : \n",
"Lachine Guide de la route / \n",
"Lachine Conduire un v\u00e9hicule de promenade / \n",
"Lachine Scott 2013 standard postage stamp catalogue / \n",
"Mercier-Hochelaga-Maisonneuve Cuba / \n",
"Mercier-Hochelaga-Maisonneuve New York / \n",
"Mercier-Hochelaga-Maisonneuve Guide de la route / \n",
"Montr\u00e9al-Nord Guide de la route / \n",
"Montr\u00e9al-Nord Conduire un v\u00e9hicule de promenade / \n",
"Montr\u00e9al-Nord Math-o-matique : \n",
"Outremont New York / \n",
"Outremont Paris / \n",
"Outremont Portugal / \n",
"Pierrefonds - Roxboro Guide de la route / \n",
"Pierrefonds - Roxboro Conduire un v\u00e9hicule de promenade / \n",
"Pierrefonds - Roxboro Driver's handbook / \n",
"Plateau-Mont-Royal New York / \n",
"Plateau-Mont-Royal Guide de la route / \n",
"Plateau-Mont-Royal Cuba / \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles Le dessin de manga. \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles New York / \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles Cuba / \n",
"Rosemont - La Petite-Patrie Conduire un v\u00e9hicule de promenade / \n",
"Rosemont - La Petite-Patrie Guide de la route / \n",
"Rosemont - La Petite-Patrie New York / \n",
"Saint-Laurent Driver's handbook / \n",
"Saint-Laurent Conduire un v\u00e9hicule de promenade / \n",
"Saint-Laurent Paris / \n",
"Saint-L\u00e9onard L'art de conjuguer : \n",
"Saint-L\u00e9onard Guide de la route / \n",
"Saint-L\u00e9onard La grammaire pour tous : \n",
"Sans Arroundissement Y'a des moments si merveilleux--\" :\" \n",
"Sans Arroundissement L'\u00e9nigmatique C\u00e9line Dion : \n",
"Sans Arroundissement Th\u00e9r\u00e8se Dion : \n",
"Sud-Ouest Conduire un v\u00e9hicule de promenade / \n",
"Sud-Ouest Guide de la route / \n",
"Sud-Ouest New York / \n",
"Verdun Conduire un v\u00e9hicule de promenade / \n",
"Verdun New York / \n",
"Verdun Guide de la route / \n",
"Ville-Marie New York / \n",
"Ville-Marie Conduire un v\u00e9hicule de promenade / \n",
"Ville-Marie Guide de la route / \n",
"Villeray - Saint-Michel - Parc-Extension Conduire un v\u00e9hicule de promenade / \n",
"Villeray - Saint-Michel - Parc-Extension Guide de la route / \n",
"Villeray - Saint-Michel - Parc-Extension La grammaire pour tous : \n",
"\n",
" total_loans year_loans \n",
"Ahuntsic - Cartierville 1418 48 \n",
"Ahuntsic - Cartierville 1213 37 \n",
"Ahuntsic - Cartierville 1161 74 \n",
"Anjou 616 38 \n",
"Anjou 511 28 \n",
"Anjou 184 17 \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce 1300 31 \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce 882 18 \n",
"C\u00f4te-des-Neiges - Notre-Dame-de-Gr\u00e2ce 620 101 \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve 106 9 \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve 100 12 \n",
"L'\u00cele Bizard - Sainte-Genevi\u00e8ve 99 11 \n",
"LaSalle 563 77 \n",
"LaSalle 370 16 \n",
"LaSalle 340 86 \n",
"Lachine 204 8 \n",
"Lachine 127 6 \n",
"Lachine 104 0 \n",
"Mercier-Hochelaga-Maisonneuve 835 48 \n",
"Mercier-Hochelaga-Maisonneuve 739 56 \n",
"Mercier-Hochelaga-Maisonneuve 677 22 \n",
"Montr\u00e9al-Nord 521 16 \n",
"Montr\u00e9al-Nord 487 14 \n",
"Montr\u00e9al-Nord 234 28 \n",
"Outremont 439 38 \n",
"Outremont 362 35 \n",
"Outremont 224 16 \n",
"Pierrefonds - Roxboro 595 20 \n",
"Pierrefonds - Roxboro 563 22 \n",
"Pierrefonds - Roxboro 495 18 \n",
"Plateau-Mont-Royal 605 63 \n",
"Plateau-Mont-Royal 489 23 \n",
"Plateau-Mont-Royal 424 20 \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles 886 57 \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles 645 67 \n",
"Rivi\u00e8re-des-Prairies - Pointe-aux-Trembles 388 36 \n",
"Rosemont - La Petite-Patrie 875 34 \n",
"Rosemont - La Petite-Patrie 782 63 \n",
"Rosemont - La Petite-Patrie 723 113 \n",
"Saint-Laurent 394 33 \n",
"Saint-Laurent 351 24 \n",
"Saint-Laurent 336 85 \n",
"Saint-L\u00e9onard 241 18 \n",
"Saint-L\u00e9onard 233 21 \n",
"Saint-L\u00e9onard 174 11 \n",
"Sans Arroundissement 52 5 \n",
"Sans Arroundissement 49 2 \n",
"Sans Arroundissement 47 2 \n",
"Sud-Ouest 583 33 \n",
"Sud-Ouest 316 16 \n",
"Sud-Ouest 293 33 \n",
"Verdun 279 25 \n",
"Verdun 205 61 \n",
"Verdun 168 13 \n",
"Ville-Marie 273 41 \n",
"Ville-Marie 244 20 \n",
"Ville-Marie 204 10 \n",
"Villeray - Saint-Michel - Parc-Extension 1733 66 \n",
"Villeray - Saint-Michel - Parc-Extension 1416 68 \n",
"Villeray - Saint-Michel - Parc-Extension 628 16 \n",
"\n",
"[60 rows x 3 columns]"
]
}
],
"prompt_number": 66
},
{
"cell_type": "code",
"collapsed": false,
"input": [],
"language": "python",
"metadata": {},
"outputs": []
}
],
"metadata": {}
}
]
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment