Ajout des commentaires manquants avant les codes

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