data charger il manque à les mettre en ordre

parent a0bf286c
{ {
"cells": [], "cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Suivis de l'évolution de la concentration en CO2 atmosphérique "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Sujet 1 "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Les données de concentration en CO2 atmosphérique sont issue de l'observatoire de Mauna Loa à partir de leur [site](https://scrippsco2.ucsd.edu/data/atmospheric_co2/primary_mlo_co2_record.html), les données sont récupérées le 24/02/2021 pour réalisé les calculs suivants. "
]
},
{
"cell_type": "code",
"execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"%matplotlib inline \n",
"import pandas as pd \n",
"import matplotlib.pyplot as plt \n",
"import isoweek "
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
"raw_data = pd.read_csv(\"https://scrippsco2.ucsd.edu/assets/data/atmospheric/stations/in_situ_co2/monthly/monthly_in_situ_co2_mlo.csv\", skiprows=2)"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"Vérification que les données chargées soit bien les bonnes. "
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>Yr</th>\n",
" <th>Mn</th>\n",
" <th>Date</th>\n",
" <th>Date</th>\n",
" <th>CO2</th>\n",
" <th>seasonally</th>\n",
" <th>fit</th>\n",
" <th>seasonally</th>\n",
" <th>CO2</th>\n",
" <td>seasonally</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"2\" valign=\"top\"></th>\n",
" <th rowspan=\"2\" valign=\"top\"></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th>adjusted</th>\n",
" <th></th>\n",
" <th>adjusted fit</th>\n",
" <th>filled</th>\n",
" <td>adjusted filled</td>\n",
" </tr>\n",
" <tr>\n",
" <th>Excel</th>\n",
" <th></th>\n",
" <th>[ppm]</th>\n",
" <th>[ppm]</th>\n",
" <th>[ppm]</th>\n",
" <th>[ppm]</th>\n",
" <th>[ppm]</th>\n",
" <td>[ppm]</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"12\" valign=\"top\">1958</th>\n",
" <th>01</th>\n",
" <th>21200</th>\n",
" <th>1958.0411</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <td>-99.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>02</th>\n",
" <th>21231</th>\n",
" <th>1958.1260</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <td>-99.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>03</th>\n",
" <th>21259</th>\n",
" <th>1958.2027</th>\n",
" <th>315.70</th>\n",
" <th>314.43</th>\n",
" <th>316.19</th>\n",
" <th>314.90</th>\n",
" <th>315.70</th>\n",
" <td>314.43</td>\n",
" </tr>\n",
" <tr>\n",
" <th>04</th>\n",
" <th>21290</th>\n",
" <th>1958.2877</th>\n",
" <th>317.45</th>\n",
" <th>315.16</th>\n",
" <th>317.30</th>\n",
" <th>314.98</th>\n",
" <th>317.45</th>\n",
" <td>315.16</td>\n",
" </tr>\n",
" <tr>\n",
" <th>05</th>\n",
" <th>21320</th>\n",
" <th>1958.3699</th>\n",
" <th>317.51</th>\n",
" <th>314.71</th>\n",
" <th>317.86</th>\n",
" <th>315.06</th>\n",
" <th>317.51</th>\n",
" <td>314.71</td>\n",
" </tr>\n",
" <tr>\n",
" <th>06</th>\n",
" <th>21351</th>\n",
" <th>1958.4548</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>317.24</th>\n",
" <th>315.14</th>\n",
" <th>317.24</th>\n",
" <td>315.14</td>\n",
" </tr>\n",
" <tr>\n",
" <th>07</th>\n",
" <th>21381</th>\n",
" <th>1958.5370</th>\n",
" <th>315.86</th>\n",
" <th>315.19</th>\n",
" <th>315.86</th>\n",
" <th>315.22</th>\n",
" <th>315.86</th>\n",
" <td>315.19</td>\n",
" </tr>\n",
" <tr>\n",
" <th>08</th>\n",
" <th>21412</th>\n",
" <th>1958.6219</th>\n",
" <th>314.93</th>\n",
" <th>316.19</th>\n",
" <th>313.99</th>\n",
" <th>315.29</th>\n",
" <th>314.93</th>\n",
" <td>316.19</td>\n",
" </tr>\n",
" <tr>\n",
" <th>09</th>\n",
" <th>21443</th>\n",
" <th>1958.7068</th>\n",
" <th>313.21</th>\n",
" <th>316.08</th>\n",
" <th>312.46</th>\n",
" <th>315.35</th>\n",
" <th>313.21</th>\n",
" <td>316.08</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <th>21473</th>\n",
" <th>1958.7890</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>312.43</th>\n",
" <th>315.41</th>\n",
" <th>312.43</th>\n",
" <td>315.41</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <th>21504</th>\n",
" <th>1958.8740</th>\n",
" <th>313.33</th>\n",
" <th>315.20</th>\n",
" <th>313.61</th>\n",
" <th>315.46</th>\n",
" <th>313.33</th>\n",
" <td>315.20</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <th>21534</th>\n",
" <th>1958.9562</th>\n",
" <th>314.67</th>\n",
" <th>315.43</th>\n",
" <th>314.76</th>\n",
" <th>315.51</th>\n",
" <th>314.67</th>\n",
" <td>315.43</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"12\" valign=\"top\">1959</th>\n",
" <th>01</th>\n",
" <th>21565</th>\n",
" <th>1959.0411</th>\n",
" <th>315.58</th>\n",
" <th>315.54</th>\n",
" <th>315.62</th>\n",
" <th>315.57</th>\n",
" <th>315.58</th>\n",
" <td>315.54</td>\n",
" </tr>\n",
" <tr>\n",
" <th>02</th>\n",
" <th>21596</th>\n",
" <th>1959.1260</th>\n",
" <th>316.49</th>\n",
" <th>315.86</th>\n",
" <th>316.27</th>\n",
" <th>315.63</th>\n",
" <th>316.49</th>\n",
" <td>315.86</td>\n",
" </tr>\n",
" <tr>\n",
" <th>03</th>\n",
" <th>21624</th>\n",
" <th>1959.2027</th>\n",
" <th>316.65</th>\n",
" <th>315.37</th>\n",
" <th>316.98</th>\n",
" <th>315.69</th>\n",
" <th>316.65</th>\n",
" <td>315.37</td>\n",
" </tr>\n",
" <tr>\n",
" <th>04</th>\n",
" <th>21655</th>\n",
" <th>1959.2877</th>\n",
" <th>317.72</th>\n",
" <th>315.41</th>\n",
" <th>318.09</th>\n",
" <th>315.77</th>\n",
" <th>317.72</th>\n",
" <td>315.41</td>\n",
" </tr>\n",
" <tr>\n",
" <th>05</th>\n",
" <th>21685</th>\n",
" <th>1959.3699</th>\n",
" <th>318.29</th>\n",
" <th>315.48</th>\n",
" <th>318.66</th>\n",
" <th>315.85</th>\n",
" <th>318.29</th>\n",
" <td>315.48</td>\n",
" </tr>\n",
" <tr>\n",
" <th>06</th>\n",
" <th>21716</th>\n",
" <th>1959.4548</th>\n",
" <th>318.15</th>\n",
" <th>316.03</th>\n",
" <th>318.04</th>\n",
" <th>315.94</th>\n",
" <th>318.15</th>\n",
" <td>316.03</td>\n",
" </tr>\n",
" <tr>\n",
" <th>07</th>\n",
" <th>21746</th>\n",
" <th>1959.5370</th>\n",
" <th>316.54</th>\n",
" <th>315.87</th>\n",
" <th>316.67</th>\n",
" <th>316.03</th>\n",
" <th>316.54</th>\n",
" <td>315.87</td>\n",
" </tr>\n",
" <tr>\n",
" <th>08</th>\n",
" <th>21777</th>\n",
" <th>1959.6219</th>\n",
" <th>314.80</th>\n",
" <th>316.07</th>\n",
" <th>314.82</th>\n",
" <th>316.12</th>\n",
" <th>314.80</th>\n",
" <td>316.07</td>\n",
" </tr>\n",
" <tr>\n",
" <th>09</th>\n",
" <th>21808</th>\n",
" <th>1959.7068</th>\n",
" <th>313.84</th>\n",
" <th>316.73</th>\n",
" <th>313.31</th>\n",
" <th>316.22</th>\n",
" <th>313.84</th>\n",
" <td>316.73</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <th>21838</th>\n",
" <th>1959.7890</th>\n",
" <th>313.33</th>\n",
" <th>316.33</th>\n",
" <th>313.32</th>\n",
" <th>316.31</th>\n",
" <th>313.33</th>\n",
" <td>316.33</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <th>21869</th>\n",
" <th>1959.8740</th>\n",
" <th>314.81</th>\n",
" <th>316.69</th>\n",
" <th>314.54</th>\n",
" <th>316.39</th>\n",
" <th>314.81</th>\n",
" <td>316.69</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <th>21899</th>\n",
" <th>1959.9562</th>\n",
" <th>315.58</th>\n",
" <th>316.35</th>\n",
" <th>315.72</th>\n",
" <th>316.47</th>\n",
" <th>315.58</th>\n",
" <td>316.35</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"3\" valign=\"top\">1960</th>\n",
" <th>01</th>\n",
" <th>21930</th>\n",
" <th>1960.0410</th>\n",
" <th>316.43</th>\n",
" <th>316.39</th>\n",
" <th>316.61</th>\n",
" <th>316.56</th>\n",
" <th>316.43</th>\n",
" <td>316.39</td>\n",
" </tr>\n",
" <tr>\n",
" <th>02</th>\n",
" <th>21961</th>\n",
" <th>1960.1257</th>\n",
" <th>316.98</th>\n",
" <th>316.35</th>\n",
" <th>317.28</th>\n",
" <th>316.64</th>\n",
" <th>316.98</th>\n",
" <td>316.35</td>\n",
" </tr>\n",
" <tr>\n",
" <th>03</th>\n",
" <th>21990</th>\n",
" <th>1960.2049</th>\n",
" <th>317.58</th>\n",
" <th>316.27</th>\n",
" <th>318.03</th>\n",
" <th>316.71</th>\n",
" <th>317.58</th>\n",
" <td>316.27</td>\n",
" </tr>\n",
" <tr>\n",
" <th>...</th>\n",
" <th>...</th>\n",
" <th>...</th>\n",
" <th>...</th>\n",
" <th>...</th>\n",
" <th>...</th>\n",
" <th>...</th>\n",
" <th>...</th>\n",
" <th>...</th>\n",
" <td>...</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"6\" valign=\"top\">2019</th>\n",
" <th>07</th>\n",
" <th>43661</th>\n",
" <th>2019.5370</th>\n",
" <th>411.78</th>\n",
" <th>410.97</th>\n",
" <th>412.28</th>\n",
" <th>411.50</th>\n",
" <th>411.78</th>\n",
" <td>410.97</td>\n",
" </tr>\n",
" <tr>\n",
" <th>08</th>\n",
" <th>43692</th>\n",
" <th>2019.6219</th>\n",
" <th>410.01</th>\n",
" <th>411.55</th>\n",
" <th>410.15</th>\n",
" <th>411.72</th>\n",
" <th>410.01</th>\n",
" <td>411.55</td>\n",
" </tr>\n",
" <tr>\n",
" <th>09</th>\n",
" <th>43723</th>\n",
" <th>2019.7068</th>\n",
" <th>408.48</th>\n",
" <th>411.98</th>\n",
" <th>408.43</th>\n",
" <th>411.94</th>\n",
" <th>408.48</th>\n",
" <td>411.98</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <th>43753</th>\n",
" <th>2019.7890</th>\n",
" <th>408.37</th>\n",
" <th>411.99</th>\n",
" <th>408.55</th>\n",
" <th>412.16</th>\n",
" <th>408.37</th>\n",
" <td>411.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <th>43784</th>\n",
" <th>2019.8740</th>\n",
" <th>410.22</th>\n",
" <th>412.49</th>\n",
" <th>410.13</th>\n",
" <th>412.38</th>\n",
" <th>410.22</th>\n",
" <td>412.49</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <th>43814</th>\n",
" <th>2019.9562</th>\n",
" <th>411.78</th>\n",
" <th>412.71</th>\n",
" <th>411.67</th>\n",
" <th>412.58</th>\n",
" <th>411.78</th>\n",
" <td>412.71</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"12\" valign=\"top\">2020</th>\n",
" <th>01</th>\n",
" <th>43845</th>\n",
" <th>2020.0410</th>\n",
" <th>413.31</th>\n",
" <th>413.26</th>\n",
" <th>412.86</th>\n",
" <th>412.80</th>\n",
" <th>413.31</th>\n",
" <td>413.26</td>\n",
" </tr>\n",
" <tr>\n",
" <th>02</th>\n",
" <th>43876</th>\n",
" <th>2020.1257</th>\n",
" <th>414.02</th>\n",
" <th>413.26</th>\n",
" <th>413.77</th>\n",
" <th>413.00</th>\n",
" <th>414.02</th>\n",
" <td>413.26</td>\n",
" </tr>\n",
" <tr>\n",
" <th>03</th>\n",
" <th>43905</th>\n",
" <th>2020.2049</th>\n",
" <th>414.44</th>\n",
" <th>412.87</th>\n",
" <th>414.79</th>\n",
" <th>413.19</th>\n",
" <th>414.44</th>\n",
" <td>412.87</td>\n",
" </tr>\n",
" <tr>\n",
" <th>04</th>\n",
" <th>43936</th>\n",
" <th>2020.2896</th>\n",
" <th>416.11</th>\n",
" <th>413.28</th>\n",
" <th>416.24</th>\n",
" <th>413.39</th>\n",
" <th>416.11</th>\n",
" <td>413.28</td>\n",
" </tr>\n",
" <tr>\n",
" <th>05</th>\n",
" <th>43966</th>\n",
" <th>2020.3716</th>\n",
" <th>417.10</th>\n",
" <th>413.68</th>\n",
" <th>417.00</th>\n",
" <th>413.59</th>\n",
" <th>417.10</th>\n",
" <td>413.68</td>\n",
" </tr>\n",
" <tr>\n",
" <th>06</th>\n",
" <th>43997</th>\n",
" <th>2020.4563</th>\n",
" <th>416.23</th>\n",
" <th>413.68</th>\n",
" <th>416.33</th>\n",
" <th>413.80</th>\n",
" <th>416.23</th>\n",
" <td>413.68</td>\n",
" </tr>\n",
" <tr>\n",
" <th>07</th>\n",
" <th>44027</th>\n",
" <th>2020.5383</th>\n",
" <th>414.42</th>\n",
" <th>413.63</th>\n",
" <th>414.75</th>\n",
" <th>414.01</th>\n",
" <th>414.42</th>\n",
" <td>413.63</td>\n",
" </tr>\n",
" <tr>\n",
" <th>08</th>\n",
" <th>44058</th>\n",
" <th>2020.6230</th>\n",
" <th>412.52</th>\n",
" <th>414.09</th>\n",
" <th>412.61</th>\n",
" <th>414.22</th>\n",
" <th>412.52</th>\n",
" <td>414.09</td>\n",
" </tr>\n",
" <tr>\n",
" <th>09</th>\n",
" <th>44089</th>\n",
" <th>2020.7077</th>\n",
" <th>411.19</th>\n",
" <th>414.70</th>\n",
" <th>410.91</th>\n",
" <th>414.44</th>\n",
" <th>411.19</th>\n",
" <td>414.70</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <th>44119</th>\n",
" <th>2020.7896</th>\n",
" <th>411.15</th>\n",
" <th>414.78</th>\n",
" <th>411.04</th>\n",
" <th>414.66</th>\n",
" <th>411.15</th>\n",
" <td>414.78</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <th>44150</th>\n",
" <th>2020.8743</th>\n",
" <th>412.88</th>\n",
" <th>415.15</th>\n",
" <th>412.64</th>\n",
" <th>414.88</th>\n",
" <th>412.88</th>\n",
" <td>415.15</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <th>44180</th>\n",
" <th>2020.9563</th>\n",
" <th>413.89</th>\n",
" <th>414.82</th>\n",
" <th>414.19</th>\n",
" <th>415.10</th>\n",
" <th>413.89</th>\n",
" <td>414.82</td>\n",
" </tr>\n",
" <tr>\n",
" <th rowspan=\"12\" valign=\"top\">2021</th>\n",
" <th>01</th>\n",
" <th>44211</th>\n",
" <th>2021.0411</th>\n",
" <th>415.16</th>\n",
" <th>415.11</th>\n",
" <th>415.39</th>\n",
" <th>415.33</th>\n",
" <th>415.16</th>\n",
" <td>415.11</td>\n",
" </tr>\n",
" <tr>\n",
" <th>02</th>\n",
" <th>44242</th>\n",
" <th>2021.1260</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <td>-99.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>03</th>\n",
" <th>44270</th>\n",
" <th>2021.2027</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <td>-99.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>04</th>\n",
" <th>44301</th>\n",
" <th>2021.2877</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <td>-99.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>05</th>\n",
" <th>44331</th>\n",
" <th>2021.3699</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <td>-99.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>06</th>\n",
" <th>44362</th>\n",
" <th>2021.4548</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <td>-99.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>07</th>\n",
" <th>44392</th>\n",
" <th>2021.5370</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <td>-99.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>08</th>\n",
" <th>44423</th>\n",
" <th>2021.6219</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <td>-99.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>09</th>\n",
" <th>44454</th>\n",
" <th>2021.7068</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <td>-99.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>10</th>\n",
" <th>44484</th>\n",
" <th>2021.7890</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <td>-99.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <th>44515</th>\n",
" <th>2021.8740</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <td>-99.99</td>\n",
" </tr>\n",
" <tr>\n",
" <th>12</th>\n",
" <th>44545</th>\n",
" <th>2021.9562</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <th>-99.99</th>\n",
" <td>-99.99</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"<p>771 rows × 1 columns</p>\n",
"</div>"
],
"text/plain": [
" \n",
" Yr Mn Date Date CO2 seasonally fit seasonally CO2 seasonally \n",
" adjusted adjusted fit filled adjusted filled \n",
" Excel [ppm] [ppm] [ppm] [ppm] [ppm] [ppm] \n",
"1958 01 21200 1958.0411 -99.99 -99.99 -99.99 -99.99 -99.99 -99.99 \n",
" 02 21231 1958.1260 -99.99 -99.99 -99.99 -99.99 -99.99 -99.99 \n",
" 03 21259 1958.2027 315.70 314.43 316.19 314.90 315.70 314.43 \n",
" 04 21290 1958.2877 317.45 315.16 317.30 314.98 317.45 315.16 \n",
" 05 21320 1958.3699 317.51 314.71 317.86 315.06 317.51 314.71 \n",
" 06 21351 1958.4548 -99.99 -99.99 317.24 315.14 317.24 315.14 \n",
" 07 21381 1958.5370 315.86 315.19 315.86 315.22 315.86 315.19 \n",
" 08 21412 1958.6219 314.93 316.19 313.99 315.29 314.93 316.19 \n",
" 09 21443 1958.7068 313.21 316.08 312.46 315.35 313.21 316.08 \n",
" 10 21473 1958.7890 -99.99 -99.99 312.43 315.41 312.43 315.41 \n",
" 11 21504 1958.8740 313.33 315.20 313.61 315.46 313.33 315.20 \n",
" 12 21534 1958.9562 314.67 315.43 314.76 315.51 314.67 315.43 \n",
"1959 01 21565 1959.0411 315.58 315.54 315.62 315.57 315.58 315.54 \n",
" 02 21596 1959.1260 316.49 315.86 316.27 315.63 316.49 315.86 \n",
" 03 21624 1959.2027 316.65 315.37 316.98 315.69 316.65 315.37 \n",
" 04 21655 1959.2877 317.72 315.41 318.09 315.77 317.72 315.41 \n",
" 05 21685 1959.3699 318.29 315.48 318.66 315.85 318.29 315.48 \n",
" 06 21716 1959.4548 318.15 316.03 318.04 315.94 318.15 316.03 \n",
" 07 21746 1959.5370 316.54 315.87 316.67 316.03 316.54 315.87 \n",
" 08 21777 1959.6219 314.80 316.07 314.82 316.12 314.80 316.07 \n",
" 09 21808 1959.7068 313.84 316.73 313.31 316.22 313.84 316.73 \n",
" 10 21838 1959.7890 313.33 316.33 313.32 316.31 313.33 316.33 \n",
" 11 21869 1959.8740 314.81 316.69 314.54 316.39 314.81 316.69 \n",
" 12 21899 1959.9562 315.58 316.35 315.72 316.47 315.58 316.35 \n",
"1960 01 21930 1960.0410 316.43 316.39 316.61 316.56 316.43 316.39 \n",
" 02 21961 1960.1257 316.98 316.35 317.28 316.64 316.98 316.35 \n",
" 03 21990 1960.2049 317.58 316.27 318.03 316.71 317.58 316.27 \n",
"... ... \n",
"2019 07 43661 2019.5370 411.78 410.97 412.28 411.50 411.78 410.97 \n",
" 08 43692 2019.6219 410.01 411.55 410.15 411.72 410.01 411.55 \n",
" 09 43723 2019.7068 408.48 411.98 408.43 411.94 408.48 411.98 \n",
" 10 43753 2019.7890 408.37 411.99 408.55 412.16 408.37 411.99 \n",
" 11 43784 2019.8740 410.22 412.49 410.13 412.38 410.22 412.49 \n",
" 12 43814 2019.9562 411.78 412.71 411.67 412.58 411.78 412.71 \n",
"2020 01 43845 2020.0410 413.31 413.26 412.86 412.80 413.31 413.26 \n",
" 02 43876 2020.1257 414.02 413.26 413.77 413.00 414.02 413.26 \n",
" 03 43905 2020.2049 414.44 412.87 414.79 413.19 414.44 412.87 \n",
" 04 43936 2020.2896 416.11 413.28 416.24 413.39 416.11 413.28 \n",
" 05 43966 2020.3716 417.10 413.68 417.00 413.59 417.10 413.68 \n",
" 06 43997 2020.4563 416.23 413.68 416.33 413.80 416.23 413.68 \n",
" 07 44027 2020.5383 414.42 413.63 414.75 414.01 414.42 413.63 \n",
" 08 44058 2020.6230 412.52 414.09 412.61 414.22 412.52 414.09 \n",
" 09 44089 2020.7077 411.19 414.70 410.91 414.44 411.19 414.70 \n",
" 10 44119 2020.7896 411.15 414.78 411.04 414.66 411.15 414.78 \n",
" 11 44150 2020.8743 412.88 415.15 412.64 414.88 412.88 415.15 \n",
" 12 44180 2020.9563 413.89 414.82 414.19 415.10 413.89 414.82 \n",
"2021 01 44211 2021.0411 415.16 415.11 415.39 415.33 415.16 415.11 \n",
" 02 44242 2021.1260 -99.99 -99.99 -99.99 -99.99 -99.99 -99.99 \n",
" 03 44270 2021.2027 -99.99 -99.99 -99.99 -99.99 -99.99 -99.99 \n",
" 04 44301 2021.2877 -99.99 -99.99 -99.99 -99.99 -99.99 -99.99 \n",
" 05 44331 2021.3699 -99.99 -99.99 -99.99 -99.99 -99.99 -99.99 \n",
" 06 44362 2021.4548 -99.99 -99.99 -99.99 -99.99 -99.99 -99.99 \n",
" 07 44392 2021.5370 -99.99 -99.99 -99.99 -99.99 -99.99 -99.99 \n",
" 08 44423 2021.6219 -99.99 -99.99 -99.99 -99.99 -99.99 -99.99 \n",
" 09 44454 2021.7068 -99.99 -99.99 -99.99 -99.99 -99.99 -99.99 \n",
" 10 44484 2021.7890 -99.99 -99.99 -99.99 -99.99 -99.99 -99.99 \n",
" 11 44515 2021.8740 -99.99 -99.99 -99.99 -99.99 -99.99 -99.99 \n",
" 12 44545 2021.9562 -99.99 -99.99 -99.99 -99.99 -99.99 -99.99 \n",
"\n",
"[771 rows x 1 columns]"
]
},
"execution_count": 3,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"raw_data"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"On vérifie qu'il n'y ai pas de ligne non renseigner "
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" <th></th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
"Empty DataFrame\n",
"Columns: [ ]\n",
"Index: []"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
" raw_data[raw_data.isnull().any(axis=1)]"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"ename": "KeyError",
"evalue": "'Excel'",
"output_type": "error",
"traceback": [
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
"\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m/opt/conda/lib/python3.6/site-packages/pandas/core/indexes/base.py\u001b[0m in \u001b[0;36mget_loc\u001b[0;34m(self, key, method, tolerance)\u001b[0m\n\u001b[1;32m 2524\u001b[0m \u001b[0;32mtry\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2525\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_engine\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_loc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2526\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32mpandas/_libs/index.pyx\u001b[0m in \u001b[0;36mpandas._libs.index.IndexEngine.get_loc\u001b[0;34m()\u001b[0m\n",
"\u001b[0;32mpandas/_libs/index.pyx\u001b[0m in \u001b[0;36mpandas._libs.index.IndexEngine.get_loc\u001b[0;34m()\u001b[0m\n",
"\u001b[0;32mpandas/_libs/hashtable_class_helper.pxi\u001b[0m in \u001b[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001b[0;34m()\u001b[0m\n",
"\u001b[0;32mpandas/_libs/hashtable_class_helper.pxi\u001b[0m in \u001b[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001b[0;34m()\u001b[0m\n",
"\u001b[0;31mKeyError\u001b[0m: 'Excel'",
"\nDuring handling of the above exception, another exception occurred:\n",
"\u001b[0;31mKeyError\u001b[0m Traceback (most recent call last)",
"\u001b[0;32m<ipython-input-7-92a61da90517>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mraw_data\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'period'\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0;34m[\u001b[0m\u001b[0mconvert_week\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0myw\u001b[0m\u001b[0;34m)\u001b[0m \u001b[0;32mfor\u001b[0m \u001b[0myw\u001b[0m \u001b[0;32min\u001b[0m \u001b[0mraw_data\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0;34m'Excel'\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
"\u001b[0;32m/opt/conda/lib/python3.6/site-packages/pandas/core/frame.py\u001b[0m in \u001b[0;36m__getitem__\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 2137\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_getitem_multilevel\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2138\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2139\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_getitem_column\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2140\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2141\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m_getitem_column\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/opt/conda/lib/python3.6/site-packages/pandas/core/frame.py\u001b[0m in \u001b[0;36m_getitem_column\u001b[0;34m(self, key)\u001b[0m\n\u001b[1;32m 2144\u001b[0m \u001b[0;31m# get column\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2145\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mcolumns\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mis_unique\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2146\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_get_item_cache\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2147\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2148\u001b[0m \u001b[0;31m# duplicate columns & possible reduce dimensionality\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/opt/conda/lib/python3.6/site-packages/pandas/core/generic.py\u001b[0m in \u001b[0;36m_get_item_cache\u001b[0;34m(self, item)\u001b[0m\n\u001b[1;32m 1840\u001b[0m \u001b[0mres\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mcache\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mitem\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1841\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0mres\u001b[0m \u001b[0;32mis\u001b[0m \u001b[0;32mNone\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 1842\u001b[0;31m \u001b[0mvalues\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_data\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mitem\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 1843\u001b[0m \u001b[0mres\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_box_item_values\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mitem\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mvalues\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 1844\u001b[0m \u001b[0mcache\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mitem\u001b[0m\u001b[0;34m]\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mres\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/opt/conda/lib/python3.6/site-packages/pandas/core/internals.py\u001b[0m in \u001b[0;36mget\u001b[0;34m(self, item, fastpath)\u001b[0m\n\u001b[1;32m 3841\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3842\u001b[0m \u001b[0;32mif\u001b[0m \u001b[0;32mnot\u001b[0m \u001b[0misna\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mitem\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 3843\u001b[0;31m \u001b[0mloc\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mitems\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_loc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mitem\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 3844\u001b[0m \u001b[0;32melse\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 3845\u001b[0m \u001b[0mindexer\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mnp\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0marange\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mlen\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mitems\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0misna\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mitems\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32m/opt/conda/lib/python3.6/site-packages/pandas/core/indexes/base.py\u001b[0m in \u001b[0;36mget_loc\u001b[0;34m(self, key, method, tolerance)\u001b[0m\n\u001b[1;32m 2525\u001b[0m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_engine\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_loc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2526\u001b[0m \u001b[0;32mexcept\u001b[0m \u001b[0mKeyError\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0;32m-> 2527\u001b[0;31m \u001b[0;32mreturn\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_engine\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_loc\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m_maybe_cast_indexer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 2528\u001b[0m \u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 2529\u001b[0m \u001b[0mindexer\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget_indexer\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m[\u001b[0m\u001b[0mkey\u001b[0m\u001b[0;34m]\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmethod\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mmethod\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mtolerance\u001b[0m\u001b[0;34m=\u001b[0m\u001b[0mtolerance\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
"\u001b[0;32mpandas/_libs/index.pyx\u001b[0m in \u001b[0;36mpandas._libs.index.IndexEngine.get_loc\u001b[0;34m()\u001b[0m\n",
"\u001b[0;32mpandas/_libs/index.pyx\u001b[0m in \u001b[0;36mpandas._libs.index.IndexEngine.get_loc\u001b[0;34m()\u001b[0m\n",
"\u001b[0;32mpandas/_libs/hashtable_class_helper.pxi\u001b[0m in \u001b[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001b[0;34m()\u001b[0m\n",
"\u001b[0;32mpandas/_libs/hashtable_class_helper.pxi\u001b[0m in \u001b[0;36mpandas._libs.hashtable.PyObjectHashTable.get_item\u001b[0;34m()\u001b[0m\n",
"\u001b[0;31mKeyError\u001b[0m: 'Excel'"
]
}
],
"source": [
"raw_data['period'] = [convert_week(yw) for yw in raw_data['Excel']]"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": { "metadata": {
"kernelspec": { "kernelspec": {
"display_name": "Python 3", "display_name": "Python 3",
...@@ -16,10 +973,9 @@ ...@@ -16,10 +973,9 @@
"name": "python", "name": "python",
"nbconvert_exporter": "python", "nbconvert_exporter": "python",
"pygments_lexer": "ipython3", "pygments_lexer": "ipython3",
"version": "3.6.3" "version": "3.6.4"
} }
}, },
"nbformat": 4, "nbformat": 4,
"nbformat_minor": 2 "nbformat_minor": 2
} }
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