diff --git a/04_Apply/US_Crime_Rates/Exercises_with_solutions.ipynb b/04_Apply/US_Crime_Rates/Exercises_with_solutions.ipynb index 6687d0e8..ea83f035 100644 --- a/04_Apply/US_Crime_Rates/Exercises_with_solutions.ipynb +++ b/04_Apply/US_Crime_Rates/Exercises_with_solutions.ipynb @@ -24,7 +24,9 @@ }, { "cell_type": "code", - "execution_count": 95, + "execution_count": 1, + + "metadata": {}, "outputs": [], "source": [ @@ -48,13 +50,28 @@ }, { "cell_type": "code", - "execution_count": 265, + + "execution_count": 2, + "metadata": {}, "outputs": [ { "data": { "text/html": [ "
Larceny_Theft | \n", "Vehicle_Theft | \n", "|||||||||
---|---|---|---|---|---|---|---|---|---|---|
Year | \n", + "\n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " | \n", + " |
1960 | \n", + "1960-01-01 | \n", "201385000 | \n", "4134930 | \n", "45160900 | \n", @@ -616,7 +698,7 @@ "5292100 | \n", "|||||
1970 | \n", + "1970-01-01 | \n", "220099000 | \n", "9607930 | \n", "91383800 | \n", @@ -629,7 +711,7 @@ "9739900 | \n", "|||||
1980 | \n", + "1980-01-01 | \n", "248239000 | \n", "14074328 | \n", "117048900 | \n", @@ -642,7 +724,7 @@ "11935411 | \n", "|||||
1990 | \n", + "1990-01-01 | \n", "272690813 | \n", "17527048 | \n", "119053499 | \n", @@ -655,7 +737,7 @@ "14624418 | \n", "|||||
2000 | \n", + "2000-01-01 | \n", "307006550 | \n", "13968056 | \n", "100944369 | \n", @@ -668,7 +750,7 @@ "11412834 | \n", "|||||
2010 | \n", + "2010-01-01 | \n", "318857056 | \n", "6072017 | \n", "44095950 | \n", @@ -685,24 +767,26 @@ "" ], "text/plain": [ - " Population Violent Property Murder Forcible_Rape Robbery \\\n", - "1960 201385000 4134930 45160900 106180 236720 1633510 \n", - "1970 220099000 9607930 91383800 192230 554570 4159020 \n", - "1980 248239000 14074328 117048900 206439 865639 5383109 \n", - "1990 272690813 17527048 119053499 211664 998827 5748930 \n", - "2000 307006550 13968056 100944369 163068 922499 4230366 \n", - "2010 318857056 6072017 44095950 72867 421059 1749809 \n", + " Population Violent Property Murder Forcible_Rape Robbery \\\n", + "Year \n", + "1960-01-01 201385000 4134930 45160900 106180 236720 1633510 \n", + "1970-01-01 220099000 9607930 91383800 192230 554570 4159020 \n", + "1980-01-01 248239000 14074328 117048900 206439 865639 5383109 \n", + "1990-01-01 272690813 17527048 119053499 211664 998827 5748930 \n", + "2000-01-01 307006550 13968056 100944369 163068 922499 4230366 \n", + "2010-01-01 318857056 6072017 44095950 72867 421059 1749809 \n", "\n", - " Aggravated_assault Burglary Larceny_Theft Vehicle_Theft \n", - "1960 2158520 13321100 26547700 5292100 \n", - "1970 4702120 28486000 53157800 9739900 \n", - "1980 7619130 33073494 72040253 11935411 \n", - "1990 10568963 26750015 77679366 14624418 \n", - "2000 8652124 21565176 67970291 11412834 \n", - "2010 3764142 10125170 30401698 3569080 " + " Aggravated_assault Burglary Larceny_Theft Vehicle_Theft \n", + "Year \n", + "1960-01-01 2158520 13321100 26547700 5292100 \n", + "1970-01-01 4702120 28486000 53157800 9739900 \n", + "1980-01-01 7619130 33073494 72040253 11935411 \n", + "1990-01-01 10568963 26750015 77679366 14624418 \n", + "2000-01-01 8652124 21565176 67970291 11412834 \n", + "2010-01-01 3764142 10125170 30401698 3569080 " ] }, - "execution_count": 270, + "execution_count": 7, "metadata": {}, "output_type": "execute_result" } @@ -732,34 +816,43 @@ }, { "cell_type": "code", - "execution_count": 276, + + "execution_count": 9, + "metadata": {}, "outputs": [ { "data": { "text/plain": [ - "Population 2010\n", - "Violent 1990\n", - "Property 1990\n", - "Murder 1990\n", - "Forcible_Rape 1990\n", - "Robbery 1990\n", - "Aggravated_assault 1990\n", - "Burglary 1980\n", - "Larceny_Theft 1990\n", - "Vehicle_Theft 1990\n", - "dtype: int64" + "Population 2010-01-01\n", + "Violent 1990-01-01\n", + "Property 1990-01-01\n", + "Murder 1990-01-01\n", + "Forcible_Rape 1990-01-01\n", + "Robbery 1990-01-01\n", + "Aggravated_assault 1990-01-01\n", + "Burglary 1980-01-01\n", + "Larceny_Theft 1990-01-01\n", + "Vehicle_Theft 1990-01-01\n", + "dtype: datetime64[ns]" ] }, - "execution_count": 276, + "execution_count": 9, "metadata": {}, "output_type": "execute_result" } ], "source": [ "# apparently the 90s was a pretty dangerous time in the US\n", - "crime.idxmax(0)" + "crimes.idxmax(0)" ] + }, + { + "cell_type": "code", + "execution_count": null, + "metadata": {}, + "outputs": [], + "source": [] } ], "metadata": { @@ -779,7 +872,9 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.3" + + "version": "3.7.6" + }, "toc": { "base_numbering": 1, @@ -793,6 +888,7 @@ "toc_position": {}, "toc_section_display": true, "toc_window_display": false + } }, "nbformat": 4,