"# Affichage des premières lignes des données pour vérification\n",
"# Displaying the first rows of data for verification\n",
"print(data.head())"
"print(data.head())"
]
]
},
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"A graph is made with the average CO2 concentration per year"
]
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 13,
"execution_count": 29,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
...
@@ -297,7 +305,7 @@
...
@@ -297,7 +305,7 @@
}
}
],
],
"source": [
"source": [
"# Contribution lente. Création du graphique pour montrer la concentration moyenne de CO2 par an au fil du temps\n",
"# Slow contribution. Creating the graph to show the average CO2 concentration per year over time\n",
"plt.figure(figsize=(10, 6))\n",
"plt.figure(figsize=(10, 6))\n",
"plt.plot(data['Date'], data['Mean_CO2_Concentration'], label='Mean CO2 Concentration per Year Over Time')\n",
"plt.plot(data['Date'], data['Mean_CO2_Concentration'], label='Mean CO2 Concentration per Year Over Time')\n",
"plt.title('Mean CO2 Concentration per Year Over Time')\n",
"plt.title('Mean CO2 Concentration per Year Over Time')\n",
...
@@ -307,9 +315,18 @@
...
@@ -307,9 +315,18 @@
"plt.show()"
"plt.show()"
]
]
},
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The graph with the average values per year shows horizontal segments for each year which can give the wrong indication that the concentration is constant throughout the year.\n",
"\n",
"To correct this aspect of the graph, a new graph is made but indicating the average CO2 concentration value for the year with a point."
]
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 37,
"execution_count": 30,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
...
@@ -327,25 +344,32 @@
...
@@ -327,25 +344,32 @@
}
}
],
],
"source": [
"source": [
"# Contribution lente\n",
"# Slow contribution\n",
"# Calcula el promedio anual de concentraciones de CO2\n",
"# Determine the annual average of CO2 concentrations\n",
"plt.plot(annual_mean_co2.index, annual_mean_co2.values, marker='o', linestyle='-', label='Mean CO2 Concentration per Year Over Time')\n",
"plt.title('Promedio anual de concentraciones de CO2')\n",
"plt.title('Mean CO2 Concentration per Year Over Time')\n",
"plt.xlabel('Año')\n",
"plt.xlabel('Year')\n",
"plt.ylabel('Concentración de CO2 (ppm)')\n",
"plt.ylabel('CO2 Concentration (ppm)')\n",
"plt.grid(True)\n",
"plt.grid(True)\n",
"plt.show()"
"plt.show()"
]
]
},
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"We now proceed to analyze and determine the periodic oscillation.\n",
"\n",
"For this, a new column \"Oscilation\" is created in the Pandas table with the difference between the original CO2 concentration value and the average value per year calculated in the \"Mean_CO2_Concentration\" column"
]
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 14,
"execution_count": 32,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
...
@@ -386,15 +419,15 @@
...
@@ -386,15 +419,15 @@
}
}
],
],
"source": [
"source": [
"# Oscillation périodique. Obtencion de la oscilacion et créez une nouvelle colonne 'Oscilation'\n",
"# Periodic oscillation. Obtaining the oscillation and creating a new colony 'Oscillation'\n",
"# Affichage des premières lignes des données pour vérification\n",
"# Displaying the first rows of data for verification\n",
"print(data.head())"
"print(data.head())"
]
]
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 15,
"execution_count": 38,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
...
@@ -411,7 +444,7 @@
...
@@ -411,7 +444,7 @@
}
}
],
],
"source": [
"source": [
"# Oscillation périodique. Création du graphique pour montrer l'oscillation de la concentration de CO2 au fil du temps\n",
"# Periodic oscillation. Creation of the graph to monitor the oscillation of the CO2 concentration over the time\n",
"plt.figure(figsize=(10, 6))\n",
"plt.figure(figsize=(10, 6))\n",
"plt.plot(data['Date'], data['Oscilation'], label='Oscilation CO2 Concentration Over Time')\n",
"plt.plot(data['Date'], data['Oscilation'], label='Oscilation CO2 Concentration Over Time')\n",
"plt.title('Oscilation CO2 Concentration Over Time')\n",
"plt.title('Oscilation CO2 Concentration Over Time')\n",
...
@@ -423,7 +456,7 @@
...
@@ -423,7 +456,7 @@
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 16,
"execution_count": 41,
"metadata": {},
"metadata": {},
"outputs": [
"outputs": [
{
{
...
@@ -440,7 +473,7 @@
...
@@ -440,7 +473,7 @@
}
}
],
],
"source": [
"source": [
"# Oscillation périodique. Création du graphique pour montrer l'oscillation de la concentration de CO2 au fil du temps (300 dernières lignes du tableau)\n",
"# Periodic oscillation. Creation of the graph to monitor the oscillation of the CO2 concentration over the time (last 300 rows of the table)\n",
"plt.figure(figsize=(10, 6))\n",
"plt.figure(figsize=(10, 6))\n",
"plt.plot(data['Date'][-300:], data['Oscilation'][-300:], label='Oscilation CO2 Concentration Over Time')\n",
"plt.plot(data['Date'][-300:], data['Oscilation'][-300:], label='Oscilation CO2 Concentration Over Time')\n",
"plt.title('Oscilation CO2 Concentration Over Time')\n",
"plt.title('Oscilation CO2 Concentration Over Time')\n",
...
@@ -454,16 +487,19 @@
...
@@ -454,16 +487,19 @@
"cell_type": "markdown",
"cell_type": "markdown",
"metadata": {},
"metadata": {},
"source": [
"source": [
"Contribution lente. Pour la contribution lente et ensuite l’extrapolation ultérieure, aucune technique compliquée ne sera appliquée. Nous allons essayer de ajuster une ligne droite. De même, on peut ajuster une ligne droite, une parabole, une exponentielle, puis sélectionner ce qui fonctionne le mieux. Notre premier objectif n'est pas de mettre en œuvre des techniques mathématiques avancées, mais de rédiger un document informatique clair et compréhensible"
"Slow contribution. For the slow contribution and then subsequent extrapolation, no complicated techniques is applied. We try to fit a straight line. Likewise, one can fit a straight line, a parabola, an exponential, and then select what works best. Our first objective is not to implement advanced mathematical techniques, but to write a clear and understandable computer document\n",
"\n",
"Model the slow evolution for extrapolation to 2025"
]
]
},
},
{
{
"cell_type": "code",
"cell_type": "code",
"execution_count": 17,
"execution_count": 42,
"metadata": {},
"metadata": {},
"outputs": [],
"outputs": [],
"source": [
"source": [
"# Contribution lente. Modéliser la évolution lente pour extrapolation jusqu’en 2025\n",
"# Slow contribution. Model the slow evolution for extrapolation to 2025\n",