diff --git a/module3/exo2/exercice.ipynb b/module3/exo2/exercice.ipynb index 01858427ffb3e3b4a3f08a679427a8f5ca59954b..c388468073e0cf04a36af5011be97f0866fd452c 100644 --- a/module3/exo2/exercice.ipynb +++ b/module3/exo2/exercice.ipynb @@ -1319,11 +1319,11 @@ }, { "cell_type": "code", - "execution_count": 14, + "execution_count": 20, "metadata": {}, "outputs": [], "source": [ - "first_august_week = [pd.Period(pd.Timestamp(y, 9, 1), 'W')\n", + "first_sept_week = [pd.Period(pd.Timestamp(y, 9, 1), 'W')\n", " for y in range(1991,\n", " sorted_data.index[-1].year)]" ] @@ -1339,14 +1339,14 @@ }, { "cell_type": "code", - "execution_count": 15, + "execution_count": 21, "metadata": {}, "outputs": [], "source": [ "year = []\n", "yearly_incidence = []\n", - "for week1, week2 in zip(first_august_week[:-1],\n", - " first_august_week[1:]):\n", + "for week1, week2 in zip(first_sept_week[:-1],\n", + " first_sept_week[1:]):\n", " one_year = sorted_data['inc'][week1:week2-1]\n", " assert abs(len(one_year)-52) < 2\n", " yearly_incidence.append(one_year.sum())\n", @@ -1363,16 +1363,16 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 22, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 16, + "execution_count": 22, "metadata": {}, "output_type": "execute_result" }, @@ -1402,53 +1402,47 @@ }, { "cell_type": "code", - "execution_count": 16, + "execution_count": 23, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "2021 743449\n", - "2014 1600941\n", - "1991 1659249\n", - "1995 1840410\n", - "2020 2010315\n", - "2022 2060304\n", - "2012 2175217\n", - "2003 2234584\n", - "2019 2254386\n", - "2006 2307352\n", - "2017 2321583\n", - "2001 2529279\n", - "1992 2574578\n", - "1993 2703886\n", - "2018 2705325\n", - "1988 2765617\n", - "2007 2780164\n", - "1987 2855570\n", - "2016 2856393\n", - "2011 2857040\n", - "2008 2973918\n", - "1998 3034904\n", - "2002 3125418\n", - "2009 3444020\n", - "1994 3514763\n", - "1996 3539413\n", - "2004 3567744\n", - "1997 3620066\n", - "2015 3654892\n", - "2000 3826372\n", - "2005 3835025\n", - "1999 3908112\n", - "2010 4111392\n", - "2013 4182691\n", - "1986 5115251\n", - "1990 5235827\n", - "1989 5466192\n", + "2020 221186\n", + "2021 376290\n", + "2002 516689\n", + "2018 542312\n", + "2017 551041\n", + "1996 564901\n", + "2019 584066\n", + "2015 604382\n", + "2000 617597\n", + "2001 619041\n", + "2012 624573\n", + "2005 628464\n", + "2006 632833\n", + "2022 641397\n", + "2011 642368\n", + "1993 643387\n", + "1995 652478\n", + "1994 661409\n", + "1998 677775\n", + "1997 683434\n", + "2014 685769\n", + "2013 698332\n", + "2007 717352\n", + "2008 749478\n", + "1999 756456\n", + "2003 758363\n", + "2004 777388\n", + "2016 782114\n", + "2010 829911\n", + "1992 832939\n", + "2009 842373\n", "dtype: int64" ] }, - "execution_count": 16, + "execution_count": 23, "metadata": {}, "output_type": "execute_result" } @@ -1466,16 +1460,16 @@ }, { "cell_type": "code", - "execution_count": 18, + "execution_count": 24, "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "" + "" ] }, - "execution_count": 18, + "execution_count": 24, "metadata": {}, "output_type": "execute_result" },