diff --git a/week13/inClass_week13.ipynb b/week13/inClass_week13.ipynb index 799448f..27c6ae6 100644 --- a/week13/inClass_week13.ipynb +++ b/week13/inClass_week13.ipynb @@ -265,7 +265,7 @@ { "cell_type": "code", "execution_count": 5, - "id": "22cd6524", + "id": "ad40aaf6", "metadata": {}, "outputs": [ { @@ -358,7 +358,7 @@ { "cell_type": "code", "execution_count": 6, - "id": "d87358e5", + "id": "7e490fdc", "metadata": {}, "outputs": [ { @@ -390,7 +390,7 @@ { "cell_type": "code", "execution_count": 7, - "id": "20d45484", + "id": "aabb8388", "metadata": {}, "outputs": [], "source": [ @@ -400,7 +400,7 @@ { "cell_type": "code", "execution_count": 8, - "id": "e845b148", + "id": "7c323c6b", "metadata": {}, "outputs": [ { @@ -610,7 +610,7 @@ { "cell_type": "code", "execution_count": 9, - "id": "ee1f65c0", + "id": "0ec1a82a", "metadata": {}, "outputs": [ { @@ -703,7 +703,7 @@ { "cell_type": "code", "execution_count": 10, - "id": "f93fd115", + "id": "735e8f5d", "metadata": {}, "outputs": [], "source": [ @@ -713,7 +713,7 @@ { "cell_type": "code", "execution_count": 11, - "id": "214499a2", + "id": "98aadc7a", "metadata": {}, "outputs": [ { @@ -958,7 +958,7 @@ { "cell_type": "code", "execution_count": 12, - "id": "3a72c8ac", + "id": "6ebbb2f3", "metadata": {}, "outputs": [], "source": [ @@ -970,7 +970,7 @@ { "cell_type": "code", "execution_count": 17, - "id": "5aa32475", + "id": "edda1351", "metadata": {}, "outputs": [ { @@ -1055,7 +1055,7 @@ { "cell_type": "code", "execution_count": 18, - "id": "80a6bb09", + "id": "3c56d7ff", "metadata": {}, "outputs": [ { @@ -1149,7 +1149,7 @@ { "cell_type": "code", "execution_count": 19, - "id": "1fd19eca", + "id": "89ab8a7d", "metadata": {}, "outputs": [], "source": [ @@ -1159,7 +1159,7 @@ { "cell_type": "code", "execution_count": 21, - "id": "2a68f66d", + "id": "704671ec", "metadata": {}, "outputs": [ { @@ -1180,7 +1180,7 @@ { "cell_type": "code", "execution_count": 28, - "id": "f0548651", + "id": "ef250113", "metadata": {}, "outputs": [ { @@ -1280,7 +1280,7 @@ { "cell_type": "code", "execution_count": 29, - "id": "7a2a4ae5", + "id": "3b679125", "metadata": {}, "outputs": [ { @@ -1525,7 +1525,7 @@ { "cell_type": "code", "execution_count": 31, - "id": "c00a49d3", + "id": "671d0a37", "metadata": {}, "outputs": [], "source": [ @@ -1567,7 +1567,7 @@ { "cell_type": "code", "execution_count": 33, - "id": "f59d9130", + "id": "f7d57e37", "metadata": {}, "outputs": [ { @@ -1589,7 +1589,7 @@ { "cell_type": "code", "execution_count": 34, - "id": "34df86ea", + "id": "9ee83888", "metadata": {}, "outputs": [ { @@ -1611,7 +1611,7 @@ { "cell_type": "code", "execution_count": 35, - "id": "e7708e66", + "id": "2446bffe", "metadata": {}, "outputs": [ { @@ -1633,7 +1633,7 @@ { "cell_type": "code", "execution_count": 36, - "id": "4958702c", + "id": "bf39b31c", "metadata": {}, "outputs": [ { @@ -1661,7 +1661,7 @@ { "cell_type": "code", "execution_count": 37, - "id": "d3e433d0", + "id": "a25c5b4f", "metadata": {}, "outputs": [ { @@ -1732,7 +1732,7 @@ { "cell_type": "code", "execution_count": 38, - "id": "9a5d2509", + "id": "56079d0f", "metadata": {}, "outputs": [ { @@ -1753,7 +1753,7 @@ { "cell_type": "code", "execution_count": 39, - "id": "2095acee", + "id": "cea019df", "metadata": {}, "outputs": [ { @@ -2001,7 +2001,7 @@ { "cell_type": "code", "execution_count": 40, - "id": "86b53c90", + "id": "1795ae5a", "metadata": {}, "outputs": [ { @@ -2062,7 +2062,7 @@ { "cell_type": "code", "execution_count": 41, - "id": "74f8cd43", + "id": "03177a9a", "metadata": {}, "outputs": [ { @@ -2475,7 +2475,7 @@ { "cell_type": "code", "execution_count": 42, - "id": "cf4746cb", + "id": "906c34ee", "metadata": {}, "outputs": [ { @@ -2700,7 +2700,7 @@ { "cell_type": "code", "execution_count": 43, - "id": "04972ac6", + "id": "078b34ca", "metadata": {}, "outputs": [], "source": [ @@ -2710,7 +2710,7 @@ { "cell_type": "code", "execution_count": 44, - "id": "a9f5c576", + "id": "5d67b520", "metadata": {}, "outputs": [], "source": [ @@ -2720,7 +2720,7 @@ { "cell_type": "code", "execution_count": 45, - "id": "a076c0a2", + "id": "5b86c8ac", "metadata": {}, "outputs": [ { @@ -2741,7 +2741,7 @@ { "cell_type": "code", "execution_count": 46, - "id": "72722354", + "id": "88cbd905", "metadata": {}, "outputs": [ { @@ -2994,7 +2994,7 @@ { "cell_type": "code", "execution_count": 47, - "id": "06aeeb2a", + "id": "ad1d356a", "metadata": {}, "outputs": [], "source": [ @@ -3005,7 +3005,7 @@ { "cell_type": "code", "execution_count": 48, - "id": "dd92ee6a", + "id": "e2136831", "metadata": {}, "outputs": [ { @@ -3274,7 +3274,7 @@ { "cell_type": "code", "execution_count": 51, - "id": "09669a55", + "id": "5a0fcbf9", "metadata": {}, "outputs": [ { @@ -3360,7 +3360,7 @@ { "cell_type": "code", "execution_count": 60, - "id": "79e5b684", + "id": "0d05a51c", "metadata": {}, "outputs": [ { @@ -3467,7 +3467,7 @@ { "cell_type": "code", "execution_count": 66, - "id": "032e1d7a", + "id": "d94c5976", "metadata": {}, "outputs": [ { @@ -3720,7 +3720,7 @@ { "cell_type": "code", "execution_count": 68, - "id": "b079f12b", + "id": "2cadc6cb", "metadata": {}, "outputs": [ { @@ -3782,7 +3782,7 @@ { "cell_type": "code", "execution_count": 69, - "id": "28328e54", + "id": "c30b6aef", "metadata": {}, "outputs": [], "source": [ @@ -3792,7 +3792,7 @@ { "cell_type": "code", "execution_count": 70, - "id": "ca432fe8", + "id": "a9c7c115", "metadata": {}, "outputs": [ { @@ -4061,7 +4061,7 @@ { "cell_type": "code", "execution_count": 71, - "id": "bd14c76e", + "id": "5ddcc428", "metadata": {}, "outputs": [ { @@ -4153,7 +4153,7 @@ { "cell_type": "code", "execution_count": 80, - "id": "048589ef", + "id": "8f4e5065", "metadata": {}, "outputs": [ { @@ -4261,7 +4261,7 @@ { "cell_type": "code", "execution_count": 81, - "id": "c254725f", + "id": "055cf988", "metadata": {}, "outputs": [ { @@ -4530,7 +4530,7 @@ { "cell_type": "code", "execution_count": 82, - "id": "d3cecdf7", + "id": "19e185f2", "metadata": {}, "outputs": [ { @@ -4800,7 +4800,7 @@ { "cell_type": "code", "execution_count": 84, - "id": "d0614e5e", + "id": "8c4fd483", "metadata": {}, "outputs": [ { @@ -6065,13 +6065,295 @@ "corg_clean2.loc[:,(corg_clean2.columns!='Latitude')&(corg_clean2.columns!='Longitude')].cumsum(axis=1)" ] }, + { + "cell_type": "code", + "execution_count": 85, + "id": "cf5f5d3f", + "metadata": {}, + "outputs": [], + "source": [ + "corg_clean2.loc[:,(corg_clean2.columns!='Latitude')&(corg_clean2.columns!='Longitude')] = \\\n", + " corg_clean2.loc[:,(corg_clean2.columns!='Latitude')&(corg_clean2.columns!='Longitude')].cumsum(axis=1)" + ] + }, + { + "cell_type": "code", + "execution_count": 86, + "id": "bed448d9", + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + "\n", + "\n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + " \n", + "
Years1917-01-01 00:00:001918-01-01 00:00:001919-01-01 00:00:001920-01-01 00:00:001921-01-01 00:00:001922-01-01 00:00:001923-01-01 00:00:001924-01-01 00:00:001925-01-01 00:00:001926-01-01 00:00:00...2013-01-01 00:00:002014-01-01 00:00:002015-01-01 00:00:002016-01-01 00:00:002017-01-01 00:00:002018-01-01 00:00:002019-01-01 00:00:002020-01-01 00:00:00LatitudeLongitude
Country
United States0000000000...147891506915370155991581216010161281613039.783730-100.445882
Brazil0000000000...11111111-10.333333-53.200000
Russia0000000000...4595868231040130016291818183464.68631497.745306
Japan0000000000...3335777736.574844139.239418
Vietnam0000000000...0000144415.926666107.965086
\n", + "

5 rows × 106 columns

\n", + "
" + ], + "text/plain": [ + "Years 1917-01-01 00:00:00 1918-01-01 00:00:00 1919-01-01 00:00:00 \\\n", + "Country \n", + "United States 0 0 0 \n", + "Brazil 0 0 0 \n", + "Russia 0 0 0 \n", + "Japan 0 0 0 \n", + "Vietnam 0 0 0 \n", + "\n", + "Years 1920-01-01 00:00:00 1921-01-01 00:00:00 1922-01-01 00:00:00 \\\n", + "Country \n", + "United States 0 0 0 \n", + "Brazil 0 0 0 \n", + "Russia 0 0 0 \n", + "Japan 0 0 0 \n", + "Vietnam 0 0 0 \n", + "\n", + "Years 1923-01-01 00:00:00 1924-01-01 00:00:00 1925-01-01 00:00:00 \\\n", + "Country \n", + "United States 0 0 0 \n", + "Brazil 0 0 0 \n", + "Russia 0 0 0 \n", + "Japan 0 0 0 \n", + "Vietnam 0 0 0 \n", + "\n", + "Years 1926-01-01 00:00:00 ... 2013-01-01 00:00:00 \\\n", + "Country ... \n", + "United States 0 ... 14789 \n", + "Brazil 0 ... 1 \n", + "Russia 0 ... 459 \n", + "Japan 0 ... 3 \n", + "Vietnam 0 ... 0 \n", + "\n", + "Years 2014-01-01 00:00:00 2015-01-01 00:00:00 2016-01-01 00:00:00 \\\n", + "Country \n", + "United States 15069 15370 15599 \n", + "Brazil 1 1 1 \n", + "Russia 586 823 1040 \n", + "Japan 3 3 5 \n", + "Vietnam 0 0 0 \n", + "\n", + "Years 2017-01-01 00:00:00 2018-01-01 00:00:00 2019-01-01 00:00:00 \\\n", + "Country \n", + "United States 15812 16010 16128 \n", + "Brazil 1 1 1 \n", + "Russia 1300 1629 1818 \n", + "Japan 7 7 7 \n", + "Vietnam 1 4 4 \n", + "\n", + "Years 2020-01-01 00:00:00 Latitude Longitude \n", + "Country \n", + "United States 16130 39.783730 -100.445882 \n", + "Brazil 1 -10.333333 -53.200000 \n", + "Russia 1834 64.686314 97.745306 \n", + "Japan 7 36.574844 139.239418 \n", + "Vietnam 4 15.926666 107.965086 \n", + "\n", + "[5 rows x 106 columns]" + ] + }, + "execution_count": 86, + "metadata": {}, + "output_type": "execute_result" + } + ], + "source": [ + "corg_clean2.head()" + ] + }, { "cell_type": "code", "execution_count": null, - "id": "19e878d7", + "id": "5f94bae6", "metadata": {}, "outputs": [], - "source": [] + "source": [ + "corg_melt = corg_clean2.reset_index().melt(['Count'])" + ] } ], "metadata": {