From 165bdf46d8187503eafe582bebb10a3345ca4fb6 Mon Sep 17 00:00:00 2001 From: richik-ray <45549622+richik-ray@users.noreply.github.com> Date: Sun, 3 Nov 2019 10:52:13 -0500 Subject: [PATCH] Add files via upload --- data/Data Parsing and Merging.ipynb | 1450 +++++++++++++++++++++++++++ 1 file changed, 1450 insertions(+) create mode 100644 data/Data Parsing and Merging.ipynb diff --git a/data/Data Parsing and Merging.ipynb b/data/Data Parsing and Merging.ipynb new file mode 100644 index 0000000..1db9cdc --- /dev/null +++ b/data/Data Parsing and Merging.ipynb @@ -0,0 +1,1450 @@ +{ + "cells": [ + { + "cell_type": "code", + "execution_count": 1, + "metadata": {}, + "outputs": [], + "source": [ + "import os\n", + "import pandas as pd\n", + "import math\n", + "pd.set_option('display.max_columns', None)\n", + "pd.set_option('display.max_colwidth', -1)" + ] + }, + { + "cell_type": "code", + "execution_count": 62, + "metadata": {}, + "outputs": [ + { + "data": { + "text/html": [ + "
\n", + " | Value | \n", + "County, State | \n", + "
---|---|---|
0 | \n", + "0.90 | \n", + "Autauga, AL | \n", + "
1 | \n", + "0.86 | \n", + "Baldwin, AL | \n", + "
2 | \n", + "0.81 | \n", + "Barbour, AL | \n", + "
3 | \n", + "0.84 | \n", + "Bibb, AL | \n", + "
4 | \n", + "0.93 | \n", + "Blount, AL | \n", + "
5 | \n", + "0.70 | \n", + "Bullock, AL | \n", + "
6 | \n", + "0.82 | \n", + "Butler, AL | \n", + "
7 | \n", + "0.92 | \n", + "Calhoun, AL | \n", + "
8 | \n", + "0.86 | \n", + "Chambers, AL | \n", + "
9 | \n", + "0.95 | \n", + "Cherokee, AL | \n", + "
10 | \n", + "0.88 | \n", + "Chilton, AL | \n", + "
11 | \n", + "0.79 | \n", + "Choctaw, AL | \n", + "
12 | \n", + "0.91 | \n", + "Clarke, AL | \n", + "
13 | \n", + "0.90 | \n", + "Clay, AL | \n", + "
14 | \n", + "0.98 | \n", + "Cleburne, AL | \n", + "
15 | \n", + "0.93 | \n", + "Coffee, AL | \n", + "
16 | \n", + "0.92 | \n", + "Colbert, AL | \n", + "
17 | \n", + "0.80 | \n", + "Conecuh, AL | \n", + "
18 | \n", + "0.83 | \n", + "Coosa, AL | \n", + "
19 | \n", + "0.95 | \n", + "Covington, AL | \n", + "
20 | \n", + "0.89 | \n", + "Crenshaw, AL | \n", + "
21 | \n", + "0.91 | \n", + "Cullman, AL | \n", + "
22 | \n", + "0.90 | \n", + "Dale, AL | \n", + "
23 | \n", + "0.86 | \n", + "Dallas, AL | \n", + "
24 | \n", + "0.93 | \n", + "DeKalb, AL | \n", + "
25 | \n", + "0.86 | \n", + "Elmore, AL | \n", + "
26 | \n", + "0.88 | \n", + "Escambia, AL | \n", + "
27 | \n", + "0.90 | \n", + "Etowah, AL | \n", + "
28 | \n", + "0.92 | \n", + "Fayette, AL | \n", + "
29 | \n", + "0.92 | \n", + "Franklin, AL | \n", + "
... | \n", + "... | \n", + "... | \n", + "
3111 | \n", + "0.91 | \n", + "Washburn, WI | \n", + "
3112 | \n", + "0.93 | \n", + "Washington, WI | \n", + "
3113 | \n", + "0.94 | \n", + "Waukesha, WI | \n", + "
3114 | \n", + "0.89 | \n", + "Waupaca, WI | \n", + "
3115 | \n", + "0.90 | \n", + "Waushara, WI | \n", + "
3116 | \n", + "0.91 | \n", + "Winnebago, WI | \n", + "
3117 | \n", + "0.92 | \n", + "Wood, WI | \n", + "
3118 | \n", + "0.81 | \n", + "Albany, WY | \n", + "
3119 | \n", + "0.66 | \n", + "Big Horn, WY | \n", + "
3120 | \n", + "0.79 | \n", + "Campbell, WY | \n", + "
3121 | \n", + "0.78 | \n", + "Carbon, WY | \n", + "
3122 | \n", + "0.87 | \n", + "Converse, WY | \n", + "
3123 | \n", + "0.98 | \n", + "Crook, WY | \n", + "
3124 | \n", + "0.69 | \n", + "Fremont, WY | \n", + "
3125 | \n", + "0.85 | \n", + "Goshen, WY | \n", + "
3126 | \n", + "0.87 | \n", + "Hot Springs, WY | \n", + "
3127 | \n", + "0.86 | \n", + "Johnson, WY | \n", + "
3128 | \n", + "0.79 | \n", + "Laramie, WY | \n", + "
3129 | \n", + "0.91 | \n", + "Lincoln, WY | \n", + "
3130 | \n", + "0.79 | \n", + "Natrona, WY | \n", + "
3131 | \n", + "0.51 | \n", + "Niobrara, WY | \n", + "
3132 | \n", + "0.85 | \n", + "Park, WY | \n", + "
3133 | \n", + "0.84 | \n", + "Platte, WY | \n", + "
3134 | \n", + "0.86 | \n", + "Sheridan, WY | \n", + "
3135 | \n", + "0.92 | \n", + "Sublette, WY | \n", + "
3136 | \n", + "0.80 | \n", + "Sweetwater, WY | \n", + "
3137 | \n", + "0.93 | \n", + "Teton, WY | \n", + "
3138 | \n", + "0.85 | \n", + "Uinta, WY | \n", + "
3139 | \n", + "0.86 | \n", + "Washakie, WY | \n", + "
3140 | \n", + "0.90 | \n", + "Weston, WY | \n", + "
3141 rows × 2 columns
\n", + "\n", + " | County, State | \n", + "Value | \n", + "Type | \n", + "
---|---|---|---|
0 | \n", + "Autauga, AL | \n", + "0.489969 | \n", + "Political | \n", + "
1 | \n", + "Baldwin, AL | \n", + "0.571601 | \n", + "Political | \n", + "
2 | \n", + "Barbour, AL | \n", + "0.055688 | \n", + "Political | \n", + "
3 | \n", + "Bibb, AL | \n", + "0.551536 | \n", + "Political | \n", + "
4 | \n", + "Blount, AL | \n", + "0.809090 | \n", + "Political | \n", + "
5 | \n", + "Bullock, AL | \n", + "-0.507431 | \n", + "Political | \n", + "
6 | \n", + "Butler, AL | \n", + "0.134563 | \n", + "Political | \n", + "
7 | \n", + "Calhoun, AL | \n", + "0.409974 | \n", + "Political | \n", + "
8 | \n", + "Chambers, AL | \n", + "0.148129 | \n", + "Political | \n", + "
9 | \n", + "Cherokee, AL | \n", + "0.690021 | \n", + "Political | \n", + "
10 | \n", + "Chilton, AL | \n", + "0.662529 | \n", + "Political | \n", + "
11 | \n", + "Choctaw, AL | \n", + "0.136725 | \n", + "Political | \n", + "
12 | \n", + "Clarke, AL | \n", + "0.106745 | \n", + "Political | \n", + "
13 | \n", + "Clay, AL | \n", + "0.605072 | \n", + "Political | \n", + "
14 | \n", + "Cleburne, AL | \n", + "0.770514 | \n", + "Political | \n", + "
15 | \n", + "Coffee, AL | \n", + "0.561179 | \n", + "Political | \n", + "
16 | \n", + "Colbert, AL | \n", + "0.378647 | \n", + "Political | \n", + "
17 | \n", + "Conecuh, AL | \n", + "0.051632 | \n", + "Political | \n", + "
18 | \n", + "Coosa, AL | \n", + "0.304455 | \n", + "Political | \n", + "
19 | \n", + "Covington, AL | \n", + "0.682560 | \n", + "Political | \n", + "
20 | \n", + "Crenshaw, AL | \n", + "0.454603 | \n", + "Political | \n", + "
21 | \n", + "Cullman, AL | \n", + "0.770760 | \n", + "Political | \n", + "
22 | \n", + "Dale, AL | \n", + "0.501093 | \n", + "Political | \n", + "
23 | \n", + "Dallas, AL | \n", + "-0.375000 | \n", + "Political | \n", + "
24 | \n", + "DeKalb, AL | \n", + "0.688570 | \n", + "Political | \n", + "
25 | \n", + "Elmore, AL | \n", + "0.515056 | \n", + "Political | \n", + "
26 | \n", + "Escambia, AL | \n", + "0.359043 | \n", + "Political | \n", + "
27 | \n", + "Etowah, AL | \n", + "0.496128 | \n", + "Political | \n", + "
28 | \n", + "Fayette, AL | \n", + "0.648563 | \n", + "Political | \n", + "
29 | \n", + "Franklin, AL | \n", + "0.603738 | \n", + "Political | \n", + "
... | \n", + "... | \n", + "... | \n", + "... | \n", + "
3123 | \n", + "Washburn, WI | \n", + "0.231745 | \n", + "Political | \n", + "
3124 | \n", + "Washington, WI | \n", + "0.395805 | \n", + "Political | \n", + "
3125 | \n", + "Waukesha, WI | \n", + "0.264895 | \n", + "Political | \n", + "
3126 | \n", + "Waupaca, WI | \n", + "0.297764 | \n", + "Political | \n", + "
3127 | \n", + "Waushara, WI | \n", + "0.323110 | \n", + "Political | \n", + "
3128 | \n", + "Winnebago, WI | \n", + "0.073373 | \n", + "Political | \n", + "
3129 | \n", + "Wood, WI | \n", + "0.192354 | \n", + "Political | \n", + "
3130 | \n", + "Albany, WY | \n", + "0.041735 | \n", + "Political | \n", + "
3131 | \n", + "Big Horn, WY | \n", + "0.651307 | \n", + "Political | \n", + "
3132 | \n", + "Campbell, WY | \n", + "0.794219 | \n", + "Political | \n", + "
3133 | \n", + "Carbon, WY | \n", + "0.491057 | \n", + "Political | \n", + "
3134 | \n", + "Converse, WY | \n", + "0.729185 | \n", + "Political | \n", + "
3135 | \n", + "Crook, WY | \n", + "0.803711 | \n", + "Political | \n", + "
3136 | \n", + "Fremont, WY | \n", + "0.409270 | \n", + "Political | \n", + "
3137 | \n", + "Goshen, WY | \n", + "0.602830 | \n", + "Political | \n", + "
3138 | \n", + "Hot Springs, WY | \n", + "0.595128 | \n", + "Political | \n", + "
3139 | \n", + "Johnson, WY | \n", + "0.642744 | \n", + "Political | \n", + "
3140 | \n", + "Laramie, WY | \n", + "0.324001 | \n", + "Political | \n", + "
3141 | \n", + "Lincoln, WY | \n", + "0.639324 | \n", + "Political | \n", + "
3142 | \n", + "Natrona, WY | \n", + "0.509026 | \n", + "Political | \n", + "
3143 | \n", + "Niobrara, WY | \n", + "0.761796 | \n", + "Political | \n", + "
3144 | \n", + "Park, WY | \n", + "0.568400 | \n", + "Political | \n", + "
3145 | \n", + "Platte, WY | \n", + "0.600132 | \n", + "Political | \n", + "
3146 | \n", + "Sheridan, WY | \n", + "0.505789 | \n", + "Political | \n", + "
3147 | \n", + "Sublette, WY | \n", + "0.629841 | \n", + "Political | \n", + "
3148 | \n", + "Sweetwater, WY | \n", + "0.520899 | \n", + "Political | \n", + "
3149 | \n", + "Teton, WY | \n", + "-0.268710 | \n", + "Political | \n", + "
3150 | \n", + "Uinta, WY | \n", + "0.584652 | \n", + "Political | \n", + "
3151 | \n", + "Washakie, WY | \n", + "0.623755 | \n", + "Political | \n", + "
3152 | \n", + "Weston, WY | \n", + "0.775383 | \n", + "Political | \n", + "
3153 rows × 3 columns
\n", + "\n", + " | County, State | \n", + "Type | \n", + "Value | \n", + "
---|---|---|---|
0 | \n", + "Autauga, AL | \n", + "Temp | \n", + "66.0 | \n", + "
1 | \n", + "Baldwin, AL | \n", + "Temp | \n", + "68.7 | \n", + "
2 | \n", + "Barbour, AL | \n", + "Temp | \n", + "66.8 | \n", + "
3 | \n", + "Bibb, AL | \n", + "Temp | \n", + "64.4 | \n", + "
4 | \n", + "Blount, AL | \n", + "Temp | \n", + "63.2 | \n", + "
5 | \n", + "Bullock, AL | \n", + "Temp | \n", + "66.3 | \n", + "
6 | \n", + "Butler, AL | \n", + "Temp | \n", + "66.8 | \n", + "
7 | \n", + "Calhoun, AL | \n", + "Temp | \n", + "63.4 | \n", + "
8 | \n", + "Chambers, AL | \n", + "Temp | \n", + "63.8 | \n", + "
9 | \n", + "Cherokee, AL | \n", + "Temp | \n", + "62.7 | \n", + "
10 | \n", + "Chilton, AL | \n", + "Temp | \n", + "64.4 | \n", + "
11 | \n", + "Choctaw, AL | \n", + "Temp | \n", + "66.4 | \n", + "
12 | \n", + "Clarke, AL | \n", + "Temp | \n", + "66.9 | \n", + "
13 | \n", + "Clay, AL | \n", + "Temp | \n", + "62.9 | \n", + "
14 | \n", + "Cleburne, AL | \n", + "Temp | \n", + "62.6 | \n", + "
15 | \n", + "Coffee, AL | \n", + "Temp | \n", + "67.5 | \n", + "
16 | \n", + "Colbert, AL | \n", + "Temp | \n", + "62.0 | \n", + "
17 | \n", + "Conecuh, AL | \n", + "Temp | \n", + "67.9 | \n", + "
18 | \n", + "Coosa, AL | \n", + "Temp | \n", + "64.1 | \n", + "
19 | \n", + "Covington, AL | \n", + "Temp | \n", + "67.7 | \n", + "
20 | \n", + "Crenshaw, AL | \n", + "Temp | \n", + "66.4 | \n", + "
21 | \n", + "Cullman, AL | \n", + "Temp | \n", + "62.7 | \n", + "
22 | \n", + "Dale, AL | \n", + "Temp | \n", + "67.8 | \n", + "
23 | \n", + "Dallas, AL | \n", + "Temp | \n", + "66.3 | \n", + "
24 | \n", + "DeKalb, AL | \n", + "Temp | \n", + "61.1 | \n", + "
25 | \n", + "Elmore, AL | \n", + "Temp | \n", + "65.8 | \n", + "
26 | \n", + "Escambia, AL | \n", + "Temp | \n", + "68.3 | \n", + "
27 | \n", + "Etowah, AL | \n", + "Temp | \n", + "63.2 | \n", + "
28 | \n", + "Fayette, AL | \n", + "Temp | \n", + "63.6 | \n", + "
29 | \n", + "Franklin, AL | \n", + "Temp | \n", + "61.8 | \n", + "
... | \n", + "... | \n", + "... | \n", + "... | \n", + "
2259 | \n", + "Kanawha, WV | \n", + "HousPrices | \n", + "139900.0 | \n", + "
2260 | \n", + "Pendleton, WV | \n", + "HousPrices | \n", + "133950.0 | \n", + "
2261 | \n", + "Hancock, WV | \n", + "HousPrices | \n", + "94500.0 | \n", + "
2262 | \n", + "Hardy, WV | \n", + "HousPrices | \n", + "151950.0 | \n", + "
2263 | \n", + "Preston, WV | \n", + "HousPrices | \n", + "160500.0 | \n", + "
2264 | \n", + "Hampshire, WV | \n", + "HousPrices | \n", + "199000.0 | \n", + "
2265 | \n", + "Nicholas, WV | \n", + "HousPrices | \n", + "135500.0 | \n", + "
2266 | \n", + "Jefferson, WV | \n", + "HousPrices | \n", + "298500.0 | \n", + "
2267 | \n", + "Upshur, WV | \n", + "HousPrices | \n", + "159000.0 | \n", + "
2268 | \n", + "Uinta, WY | \n", + "HousPrices | \n", + "199900.0 | \n", + "
2269 | \n", + "Sublette, WY | \n", + "HousPrices | \n", + "260000.0 | \n", + "
2270 | \n", + "Crook, WY | \n", + "HousPrices | \n", + "269900.0 | \n", + "
2271 | \n", + "Carbon, WY | \n", + "HousPrices | \n", + "175900.0 | \n", + "
2272 | \n", + "Lincoln, WY | \n", + "HousPrices | \n", + "360000.0 | \n", + "
2273 | \n", + "Fremont, WY | \n", + "HousPrices | \n", + "225450.0 | \n", + "
2274 | \n", + "Weston, WY | \n", + "HousPrices | \n", + "182450.0 | \n", + "
2275 | \n", + "Washakie, WY | \n", + "HousPrices | \n", + "154900.0 | \n", + "
2276 | \n", + "Goshen, WY | \n", + "HousPrices | \n", + "161750.0 | \n", + "
2277 | \n", + "Natrona, WY | \n", + "HousPrices | \n", + "216900.0 | \n", + "
2278 | \n", + "Johnson, WY | \n", + "HousPrices | \n", + "248000.0 | \n", + "
2279 | \n", + "Sweetwater, WY | \n", + "HousPrices | \n", + "235000.0 | \n", + "
2280 | \n", + "Park, WY | \n", + "HousPrices | \n", + "350000.0 | \n", + "
2281 | \n", + "Teton, WY | \n", + "HousPrices | \n", + "1662500.0 | \n", + "
2282 | \n", + "Converse, WY | \n", + "HousPrices | \n", + "229925.0 | \n", + "
2283 | \n", + "Albany, WY | \n", + "HousPrices | \n", + "265000.0 | \n", + "
2284 | \n", + "Campbell, WY | \n", + "HousPrices | \n", + "229000.0 | \n", + "
2285 | \n", + "Platte, WY | \n", + "HousPrices | \n", + "190000.0 | \n", + "
2286 | \n", + "Hot Springs, WY | \n", + "HousPrices | \n", + "161250.0 | \n", + "
2287 | \n", + "Sheridan, WY | \n", + "HousPrices | \n", + "275000.0 | \n", + "
2288 | \n", + "Laramie, WY | \n", + "HousPrices | \n", + "296450.0 | \n", + "
14856 rows × 3 columns
\n", + "