Ajout des commentaires manquants avant les codes

parent d242b19d
...@@ -1067,6 +1067,7 @@ ...@@ -1067,6 +1067,7 @@
} }
], ],
"source": [ "source": [
"# create a barplot\n",
"plt.bar(my_data[\"Year\"], my_data[\"Wheat\"])" "plt.bar(my_data[\"Year\"], my_data[\"Wheat\"])"
] ]
}, },
...@@ -1079,16 +1080,16 @@ ...@@ -1079,16 +1080,16 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 7, "execution_count": 39,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"<matplotlib.collections.PolyCollection at 0x7f7af6d8aeb8>" "<matplotlib.collections.PolyCollection at 0x7f7af173d898>"
] ]
}, },
"execution_count": 7, "execution_count": 39,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
}, },
...@@ -1106,13 +1107,13 @@ ...@@ -1106,13 +1107,13 @@
} }
], ],
"source": [ "source": [
"# create a plot\n",
"plt.plot(my_data[\"Year\"], my_data[\"Wages\"], \"r\")\n", "plt.plot(my_data[\"Year\"], my_data[\"Wages\"], \"r\")\n",
"\n", "\n",
" \n", "# fill area between curve and axis\n",
"y1 = my_data[\"Wages\"]\n", "x = my_data[\"Year\"] \n",
"x = my_data[\"Year\"]\n", "y = my_data[\"Wages\"] \n",
" \n", "plt.fill_between(x, y, color='#539ecd')"
"plt.fill_between(x, y1, color='#539ecd')"
] ]
}, },
{ {
...@@ -1124,16 +1125,16 @@ ...@@ -1124,16 +1125,16 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 8, "execution_count": 43,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
"data": { "data": {
"text/plain": [ "text/plain": [
"<matplotlib.collections.PolyCollection at 0x7f7af6c8e198>" "<matplotlib.collections.PolyCollection at 0x7f7af1e835c0>"
] ]
}, },
"execution_count": 8, "execution_count": 43,
"metadata": {}, "metadata": {},
"output_type": "execute_result" "output_type": "execute_result"
}, },
...@@ -1151,17 +1152,14 @@ ...@@ -1151,17 +1152,14 @@
} }
], ],
"source": [ "source": [
"# create two plots in the same graph\n",
"p = plt.bar(my_data[\"Year\"], my_data[\"Wheat\"]), \n",
"plt.plot(my_data[\"Year\"], my_data[\"Wages\"], \"r\")\n",
"\n", "\n",
"\n", "# fill area between curve and axis\n",
"p = plt.bar(my_data[\"Year\"], my_data[\"Wheat\"]), plt.plot(my_data[\"Year\"], my_data[\"Wages\"], \"r\")\n",
"\n",
"\n",
"x = my_data[\"Year\"]\n", "x = my_data[\"Year\"]\n",
"y2 = my_data[\"Wages\"]\n", "y = my_data[\"Wages\"]\n",
"\n", "plt.fill_between(x, y, color='#539ecd')"
"\n",
"plt.fill_between(x, y2, color='#539ecd')\n",
"\n"
] ]
}, },
{ {
...@@ -1725,6 +1723,7 @@ ...@@ -1725,6 +1723,7 @@
} }
], ],
"source": [ "source": [
"# Calculate the purchase_power \n",
"# purchase_power = wages / wheat\n", "# purchase_power = wages / wheat\n",
"my_data[\"Purchase_Power\"] = my_data[\"Wages\"] / my_data[\"Wheat\"]\n", "my_data[\"Purchase_Power\"] = my_data[\"Wages\"] / my_data[\"Wheat\"]\n",
"\n", "\n",
......
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