Commit 7eb666a6 authored by Charpentier Maxime's avatar Charpentier Maxime

minor changes

parent 33765335
This diff is collapsed.
Fichier de démographie du département d'Ille et Vilaine SANS Rennes concaténé par cantons
Issu du recensement de la population de 2017 (https://www.insee.fr/fr/statistiques/4799268)
Issu du recensement de la population de 2017 (https://www.insee.fr/fr/statistiques/4799309)
This diff is collapsed.
......@@ -10,8 +10,8 @@
},
{
"cell_type": "code",
"execution_count": null,
"id": "5c9fc968",
"execution_count": 25,
"id": "437276ef",
"metadata": {},
"outputs": [],
"source": [
......@@ -20,7 +20,7 @@
},
{
"cell_type": "code",
"execution_count": 1,
"execution_count": 26,
"id": "ae4f0da1",
"metadata": {},
"outputs": [],
......@@ -44,7 +44,7 @@
},
{
"cell_type": "code",
"execution_count": 2,
"execution_count": 27,
"id": "21cb58f3",
"metadata": {},
"outputs": [],
......@@ -54,7 +54,7 @@
},
{
"cell_type": "code",
"execution_count": 3,
"execution_count": 28,
"id": "76f19387",
"metadata": {},
"outputs": [],
......@@ -64,7 +64,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 29,
"id": "10f39562",
"metadata": {},
"outputs": [],
......@@ -82,7 +82,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 30,
"id": "93249907",
"metadata": {},
"outputs": [],
......@@ -96,7 +96,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 31,
"id": "97b9938d",
"metadata": {},
"outputs": [],
......@@ -115,7 +115,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 38,
"id": "06718613",
"metadata": {
"scrolled": false
......@@ -124,10 +124,11 @@
"source": [
"mymap = ipyl.Map(center=(48.117266,-1.6777926), zoom=10, scroll_wheel_zoom=True)\n",
"\n",
"tranches = [\"P17_POP1524\", \"P17_POP2554\", \"P17_POP5579\", \"P17_POP80P\"]\n",
"csp_cols = [\"C17_PMEN_CS\"+str(k)for k in csp_cat]\n",
"tranches = [\"P17_POP0014\", \"P17_POP1529\", \"P17_POP3044\", \"P17_POP4559\", \"P17_POP6074\",\n",
" \"P17_POP75P\"]\n",
"csp_cols = [\"C17_POP15P_CS\"+str(k)for k in csp_cat]\n",
"\n",
"tranches_cols = {\"15-24\":1, \"25-54\":2, \"55-79\":3, \"80P\":4}\n",
"tranches_cols = {\"00-14\":1, \"15-29\":2, \"30-44\":3, \"45-59\":4, \"60-74\":5, \"P7-5P\":6}\n",
"\n",
"values_rennes = {str(k):tranches_cols[grennes_demo[\"MOST_AGE\"].iloc[k]] for k in range(len(grennes_demo))}\n",
"\n",
......@@ -140,7 +141,7 @@
" choro_data=values_cantons,\n",
" colormap=linear.YlOrRd_04,\n",
" value_min=1,\n",
" value_max=4,\n",
" value_max=6,\n",
" border_color='black',\n",
" style={'fillOpacity': 0.8, 'dashArray': '5, 5'},\n",
" \n",
......@@ -162,7 +163,7 @@
" choro_data=values_rennes,\n",
" colormap=linear.YlOrRd_04,\n",
" value_min=1,\n",
" value_max=4,\n",
" value_max=6,\n",
" border_color='black',\n",
" style={'fillOpacity': 0.8, 'dashArray': '5, 5'}\n",
")\n",
......@@ -189,7 +190,10 @@
" labels = [name_age(col) for col in tranches]\n",
" ax.barh(labels, values, height=.5, color=\"orange\")\n",
" ax.set_title(\"Répartition des âges du canton/iris {}\".format(value))\n",
" ax.set_xlabel(\"x 1000 hab\")\n",
" if len(value)==4:\n",
" ax.set_xlabel(\"x 1000 hab\")\n",
" else:\n",
" ax.set_xlabel(\"hab\")\n",
" ax.set_ylabel(\"Tranche d'âge\")\n",
" ax.grid()\n",
" with visu_output:\n",
......@@ -250,9 +254,11 @@
" csp(ax, value) \n",
"\n",
"\n",
"legend = ipyl.LegendControl({\"15-24 ans\":linear.YlOrRd_04.scale(1,4)(1), \n",
" \"25-54 ans\":linear.YlOrRd_04.scale(1,4)(2), \n",
" \"55-79 ans\":linear.YlOrRd_04.scale(1,4)(3)}, name=\"Tranche majoritaire\", position=\"topright\")\n",
"legend = ipyl.LegendControl({\"0-14 ans\":linear.YlOrRd_04.scale(1,6)(1), \n",
" \"15-29 ans\":linear.YlOrRd_04.scale(1,6)(2), \n",
" \"30-44 ans\":linear.YlOrRd_04.scale(1,6)(3), \n",
" \"45-59 ans\":linear.YlOrRd_04.scale(1,6)(4),\n",
" \"60-74 ans\":linear.YlOrRd_04.scale(1,6)(5)}, name=\"Tranche majoritaire\", position=\"topright\")\n",
"mymap.add_control(legend)\n",
"\n",
"dropdown.observe(handler_dropdown, names=\"value\")\n",
......@@ -271,7 +277,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 39,
"id": "8c3906af",
"metadata": {
"scrolled": false
......@@ -280,7 +286,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "f716d67038bf410fb6bcf4fc709103d4",
"model_id": "1b733a63618c4c28a57a97c7ae56968b",
"version_major": 2,
"version_minor": 0
},
......
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment