Skip to content

Commit

Permalink
feat: add all states data, start test code for NE
Browse files Browse the repository at this point in the history
  • Loading branch information
HKuz committed Aug 23, 2019
1 parent 8c5e888 commit d0288ee
Show file tree
Hide file tree
Showing 52 changed files with 179 additions and 109 deletions.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File renamed without changes.
Binary file not shown.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
288 changes: 179 additions & 109 deletions LWCF/LWCF_New_England_Funding_Analysis.ipynb
Expand Up @@ -1202,7 +1202,7 @@
},
{
"cell_type": "code",
"execution_count": 104,
"execution_count": 114,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1262,6 +1262,24 @@
" <td>Connecticut</td>\n",
" <td>New Haven County</td>\n",
" </tr>\n",
" <tr>\n",
" <th>313</th>\n",
" <td>9011</td>\n",
" <td>Connecticut</td>\n",
" <td>New London County</td>\n",
" </tr>\n",
" <tr>\n",
" <th>314</th>\n",
" <td>9013</td>\n",
" <td>Connecticut</td>\n",
" <td>Tolland County</td>\n",
" </tr>\n",
" <tr>\n",
" <th>315</th>\n",
" <td>9015</td>\n",
" <td>Connecticut</td>\n",
" <td>Windham County</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
Expand All @@ -1272,53 +1290,25 @@
"309 9003 Connecticut Hartford County\n",
"310 9005 Connecticut Litchfield County\n",
"311 9007 Connecticut Middlesex County\n",
"312 9009 Connecticut New Haven County"
"312 9009 Connecticut New Haven County\n",
"313 9011 Connecticut New London County\n",
"314 9013 Connecticut Tolland County\n",
"315 9015 Connecticut Windham County"
]
},
"execution_count": 104,
"execution_count": 114,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"county_names = pd.read_csv('./Data/county_names.csv', sep=',')\n",
"county_names[county_names['state'] == 'Connecticut'].head()"
"county_names[county_names['state'] == 'Connecticut']"
]
},
{
"cell_type": "code",
"execution_count": 100,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"array(['Alabama', 'Alaska', 'Arizona', 'Arkansas', 'California',\n",
" 'Colorado', 'Connecticut', 'Delaware', 'District of Columbia',\n",
" 'Florida', 'Georgia', 'Hawaii', 'Idaho', 'Illinois', 'Indiana',\n",
" 'Iowa', 'Kansas', 'Kentucky', 'Louisiana', 'Maine', 'Maryland',\n",
" 'Massachusetts', 'Michigan', 'Minnesota', 'Mississippi',\n",
" 'Missouri', 'Montana', 'Nebraska', 'Nevada', 'New Hampshire',\n",
" 'New Jersey', 'New Mexico', 'New York', 'North Carolina',\n",
" 'North Dakota', 'Ohio', 'Oklahoma', 'Oregon', 'Pennsylvania',\n",
" 'Rhode Island', 'South Carolina', 'South Dakota', 'Tennessee',\n",
" 'Texas', 'Utah', 'Vermont', 'Virginia', 'Washington',\n",
" 'West Virginia', 'Wisconsin', 'Wyoming', 'Puerto Rico'],\n",
" dtype=object)"
]
},
"execution_count": 100,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"county_names['state'].unique()"
]
},
{
"cell_type": "code",
"execution_count": 113,
"execution_count": 115,
"metadata": {},
"outputs": [
{
Expand Down Expand Up @@ -1351,104 +1341,104 @@
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>69</th>\n",
" <td>VT</td>\n",
" <td>ESSEX</td>\n",
" <td>12</td>\n",
" <td>339369.84</td>\n",
" <td>Essex County</td>\n",
" </tr>\n",
" <tr>\n",
" <th>70</th>\n",
" <td>VT</td>\n",
" <td>FRANKLIN</td>\n",
" <td>36</td>\n",
" <td>2158306.31</td>\n",
" <td>Franklin County</td>\n",
" <th>0</th>\n",
" <td>CT</td>\n",
" <td>FAIRFIELD</td>\n",
" <td>65</td>\n",
" <td>7745008.26</td>\n",
" <td>Fairfield County</td>\n",
" </tr>\n",
" <tr>\n",
" <th>71</th>\n",
" <td>VT</td>\n",
" <td>GRAND ISLE</td>\n",
" <td>12</td>\n",
" <td>431485.07</td>\n",
" <td>Grand Isle County</td>\n",
" <th>1</th>\n",
" <td>CT</td>\n",
" <td>HARTFORD</td>\n",
" <td>69</td>\n",
" <td>11234580.53</td>\n",
" <td>Hartford County</td>\n",
" </tr>\n",
" <tr>\n",
" <th>72</th>\n",
" <td>VT</td>\n",
" <td>LAMOILLE</td>\n",
" <td>22</td>\n",
" <td>1742214.44</td>\n",
" <td>Lamoille County</td>\n",
" <th>2</th>\n",
" <td>CT</td>\n",
" <td>LITCHFIELD</td>\n",
" <td>23</td>\n",
" <td>2082009.35</td>\n",
" <td>Litchfield County</td>\n",
" </tr>\n",
" <tr>\n",
" <th>74</th>\n",
" <td>VT</td>\n",
" <td>ORANGE</td>\n",
" <td>26</td>\n",
" <td>644489.25</td>\n",
" <td>Orange County</td>\n",
" <th>3</th>\n",
" <td>CT</td>\n",
" <td>MIDDLESEX</td>\n",
" <td>37</td>\n",
" <td>4815886.84</td>\n",
" <td>Middlesex County</td>\n",
" </tr>\n",
" <tr>\n",
" <th>75</th>\n",
" <td>VT</td>\n",
" <td>ORLEANS</td>\n",
" <td>28</td>\n",
" <td>763755.98</td>\n",
" <td>Orleans County</td>\n",
" <th>5</th>\n",
" <td>CT</td>\n",
" <td>NEW HAVEN</td>\n",
" <td>58</td>\n",
" <td>16042978.55</td>\n",
" <td>New Haven County</td>\n",
" </tr>\n",
" <tr>\n",
" <th>77</th>\n",
" <td>VT</td>\n",
" <td>RUTLAND</td>\n",
" <td>52</td>\n",
" <td>4224321.33</td>\n",
" <td>Rutland County</td>\n",
" <th>6</th>\n",
" <td>CT</td>\n",
" <td>NEW LONDON</td>\n",
" <td>53</td>\n",
" <td>10009612.67</td>\n",
" <td>New London County</td>\n",
" </tr>\n",
" <tr>\n",
" <th>78</th>\n",
" <td>VT</td>\n",
" <td>WASHINGTON</td>\n",
" <td>62</td>\n",
" <td>2688311.98</td>\n",
" <td>Washington County</td>\n",
" <th>8</th>\n",
" <td>CT</td>\n",
" <td>TOLLAND</td>\n",
" <td>27</td>\n",
" <td>1640086.59</td>\n",
" <td>Tolland County</td>\n",
" </tr>\n",
" <tr>\n",
" <th>79</th>\n",
" <td>VT</td>\n",
" <th>9</th>\n",
" <td>CT</td>\n",
" <td>WINDHAM</td>\n",
" <td>24</td>\n",
" <td>1118088.91</td>\n",
" <td>23</td>\n",
" <td>2750451.98</td>\n",
" <td>Windham County</td>\n",
" </tr>\n",
" <tr>\n",
" <th>80</th>\n",
" <td>VT</td>\n",
" <td>WINDSOR</td>\n",
" <td>47</td>\n",
" <td>1954630.59</td>\n",
" <td>Windsor County</td>\n",
" <th>10</th>\n",
" <td>MA</td>\n",
" <td>BARNSTABLE</td>\n",
" <td>19</td>\n",
" <td>6626674.09</td>\n",
" <td>Barnstable County</td>\n",
" </tr>\n",
" <tr>\n",
" <th>11</th>\n",
" <td>MA</td>\n",
" <td>BERKSHIRE</td>\n",
" <td>17</td>\n",
" <td>1578548.66</td>\n",
" <td>Berkshire County</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" State County count sum county_upd\n",
"69 VT ESSEX 12 339369.84 Essex County\n",
"70 VT FRANKLIN 36 2158306.31 Franklin County\n",
"71 VT GRAND ISLE 12 431485.07 Grand Isle County\n",
"72 VT LAMOILLE 22 1742214.44 Lamoille County\n",
"74 VT ORANGE 26 644489.25 Orange County\n",
"75 VT ORLEANS 28 763755.98 Orleans County\n",
"77 VT RUTLAND 52 4224321.33 Rutland County\n",
"78 VT WASHINGTON 62 2688311.98 Washington County\n",
"79 VT WINDHAM 24 1118088.91 Windham County\n",
"80 VT WINDSOR 47 1954630.59 Windsor County"
" State County count sum county_upd\n",
"0 CT FAIRFIELD 65 7745008.26 Fairfield County\n",
"1 CT HARTFORD 69 11234580.53 Hartford County\n",
"2 CT LITCHFIELD 23 2082009.35 Litchfield County\n",
"3 CT MIDDLESEX 37 4815886.84 Middlesex County\n",
"5 CT NEW HAVEN 58 16042978.55 New Haven County\n",
"6 CT NEW LONDON 53 10009612.67 New London County\n",
"8 CT TOLLAND 27 1640086.59 Tolland County\n",
"9 CT WINDHAM 23 2750451.98 Windham County\n",
"10 MA BARNSTABLE 19 6626674.09 Barnstable County\n",
"11 MA BERKSHIRE 17 1578548.66 Berkshire County"
]
},
"execution_count": 113,
"execution_count": 115,
"metadata": {},
"output_type": "execute_result"
}
Expand All @@ -1460,7 +1450,87 @@
"# Drop multi-county and planning rows\n",
"new = county[~county['County'].isin(['MULTI-COUNTY', 'PLANNING'])]\n",
"\n",
"new.tail(10)"
"new.head(10)"
]
},
{
"cell_type": "code",
"execution_count": 119,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"{'Alabama': 'AL',\n",
" 'Alaska': 'AK',\n",
" 'Arizona': 'AZ',\n",
" 'Arkansas': 'AR',\n",
" 'California': 'CA',\n",
" 'Colorado': 'CO',\n",
" 'Connecticut': 'CT',\n",
" 'Delaware': 'DE',\n",
" 'District of Columbia': 'DC',\n",
" 'Florida': 'FL',\n",
" 'Georgia': 'GA',\n",
" 'Hawaii': 'HI',\n",
" 'Idaho': 'ID',\n",
" 'Illinois': 'IL',\n",
" 'Indiana': 'IN',\n",
" 'Iowa': 'IA',\n",
" 'Kansas': 'KS',\n",
" 'Kentucky': 'KY',\n",
" 'Louisiana': 'LA',\n",
" 'Maine': 'ME',\n",
" 'Maryland': 'MD',\n",
" 'Massachusetts': 'MA',\n",
" 'Michigan': 'MI',\n",
" 'Minnesota': 'MN',\n",
" 'Mississippi': 'MS',\n",
" 'Missouri': 'MO',\n",
" 'Montana': 'MT',\n",
" 'Nebraska': 'NE',\n",
" 'Nevada': 'NV',\n",
" 'New Hampshire': 'NH',\n",
" 'New Jersey': 'NJ',\n",
" 'New Mexico': 'NM',\n",
" 'New York': 'NY',\n",
" 'North Carolina': 'NC',\n",
" 'North Dakota': 'ND',\n",
" 'Ohio': 'OH',\n",
" 'Oklahoma': 'OK',\n",
" 'Oregon': 'OR',\n",
" 'Pennsylvania': 'PA',\n",
" 'Rhode Island': 'RI',\n",
" 'South Carolina': 'SC',\n",
" 'South Dakota': 'SD',\n",
" 'Tennessee': 'TN',\n",
" 'Texas': 'TX',\n",
" 'Utah': 'UT',\n",
" 'Vermont': 'VT',\n",
" 'Virginia': 'VA',\n",
" 'Washington': 'WA',\n",
" 'West Virginia': 'WV',\n",
" 'Wisconsin': 'WI',\n",
" 'Wyoming': 'WY',\n",
" 'Puerto Rico': 'PR'}"
]
},
"execution_count": 119,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"# Create state name and abbrev dictionary\n",
"st_name = county_names['state'].unique()\n",
"st_abbrev = ['AL', 'AK', 'AZ', 'AR', 'CA', 'CO', 'CT', 'DE', 'DC', 'FL', 'GA',\n",
" 'HI', 'ID', 'IL', 'IN', 'IA', 'KS', 'KY', 'LA', 'ME', 'MD', 'MA',\n",
" 'MI', 'MN', 'MS', 'MO', 'MT', 'NE', 'NV', 'NH', 'NJ', 'NM', 'NY',\n",
" 'NC', 'ND', 'OH', 'OK', 'OR', 'PA', 'RI', 'SC', 'SD', 'TN', 'TX',\n",
" 'UT', 'VT', 'VA', 'WA', 'WV', 'WI', 'WY', 'PR']\n",
"\n",
"state_dict = dict(zip(st_name, st_abbrev))\n",
"state_dict"
]
},
{
Expand Down

0 comments on commit d0288ee

Please sign in to comment.