update

parent 26a98a5b
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"Les données sont extraites de l'INSEE disponibles [ici](https://www.insee.fr/fr/statistiques/serie/000442423#Telechargement). Dans un premier temps on charge les données:" "Les données sont extraites de l'INSEE disponibles [ici](https://www.insee.fr/fr/statistiques/serie/000442423#Telechargement). Dans un premier temps on charge les données à l'aide de la librairie Pandas:"
] ]
}, },
{ {
...@@ -43,9 +43,10 @@ ...@@ -43,9 +43,10 @@
"import pandas as pd\n", "import pandas as pd\n",
"\n", "\n",
"data = pd.read_csv(\"Data/valeurs_mensuelles.csv\", skiprows=4, delimiter=\";\", names=[\"Date\", \"Price\", \"Label\"], dtype={\"Date\": str, \"Price\": float, \"Label\": str})\n", "data = pd.read_csv(\"Data/valeurs_mensuelles.csv\", skiprows=4, delimiter=\";\", names=[\"Date\", \"Price\", \"Label\"], dtype={\"Date\": str, \"Price\": float, \"Label\": str})\n",
"nRow, nCol = data.shape\n",
"# On trie les données par date croissante\n",
"data.sort_values(by=\"Date\", inplace=True)\n", "data.sort_values(by=\"Date\", inplace=True)\n",
"data.reset_index(drop=True, inplace=True)\n", "data.reset_index(drop=True, inplace=True)\n",
"nRow, nCol = data.shape\n",
"print(data.head(), \"\\n...\\n\", data.tail())" "print(data.head(), \"\\n...\\n\", data.tail())"
] ]
}, },
...@@ -77,7 +78,7 @@ ...@@ -77,7 +78,7 @@
"cell_type": "markdown", "cell_type": "markdown",
"metadata": {}, "metadata": {},
"source": [ "source": [
"La plage s'étant donc de janvier 1992 à décembre 2021. Nous procédons maintenant à un peu de calcul pour voir différents indicateurs sur cette période." "La plage s'étant donc de janvier 1992 à décembre 2021. Nous procédons maintenant à un peu de calcul pour voir différents indicateurs sur le prix de la baguette sur l'ensemble de la période."
] ]
}, },
{ {
...@@ -89,7 +90,7 @@ ...@@ -89,7 +90,7 @@
"name": "stdout", "name": "stdout",
"output_type": "stream", "output_type": "stream",
"text": [ "text": [
"Prix: minimum = 2.12, maximum = 3.61, median = 3.10, std = 0.48\n" "Prix: minimum = 2.12€, maximum = 3.61€, median = 3.10€, std = 0.48€\n"
] ]
} }
], ],
...@@ -98,7 +99,7 @@ ...@@ -98,7 +99,7 @@
"priceMAx = data[\"Price\"].max()\n", "priceMAx = data[\"Price\"].max()\n",
"priceMed = data[\"Price\"].median()\n", "priceMed = data[\"Price\"].median()\n",
"priceStd = data[\"Price\"].std(ddof=1)\n", "priceStd = data[\"Price\"].std(ddof=1)\n",
"print(\"Prix: minimum = {:.2f}, maximum = {:.2f}, median = {:.2f}, std = {:.2f}\".format(priceMin, priceMAx, priceMed, priceStd))" "print(\"Prix: minimum = {:.2f}€, maximum = {:.2f}€, median = {:.2f}€, std = {:.2f}€\".format(priceMin, priceMAx, priceMed, priceStd))"
] ]
}, },
{ {
...@@ -110,7 +111,7 @@ ...@@ -110,7 +111,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 13, "execution_count": 4,
"metadata": {}, "metadata": {},
"outputs": [ "outputs": [
{ {
......
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