From 650d4516b0689c78234a6d6c6d1f3368284925a3 Mon Sep 17 00:00:00 2001 From: Rebecca Tolmach Date: Wed, 6 Apr 2016 16:57:47 -0700 Subject: [PATCH 1/8] a bunch of stuff --- poverty/est14_CA.txt | 59 ++++++++++++++++++++++++++++++++++++++++++++ poverty/est14_WA.txt | 40 ++++++++++++++++++++++++++++++ poverty/poverty.rb | 28 +++++++++++++++++++++ 3 files changed, 127 insertions(+) create mode 100644 poverty/est14_CA.txt create mode 100644 poverty/est14_WA.txt create mode 100644 poverty/poverty.rb diff --git a/poverty/est14_CA.txt b/poverty/est14_CA.txt new file mode 100644 index 0000000..01adc29 --- /dev/null +++ b/poverty/est14_CA.txt @@ -0,0 +1,59 @@ +06 0 6253423 6203456 6303390 16.4 16.3 16.5 2040811 2011678 2069944 22.6 22.3 22.9 1424469 1398503 1450435 21.9 21.5 22.3 61927 61689 62165 575759 562058 589460 23.4 22.8 24.0 California CA est14_CA.txt 06NOV2015 +06 1 197984 186953 209015 12.5 11.8 13.2 48750 43470 54030 14.3 12.8 15.8 33524 29523 37525 13.8 12.2 15.4 76996 75788 78204 Alameda County CA est14_CA.txt 06NOV2015 +06 3 211 164 258 19.0 14.7 23.3 62 47 77 28.2 21.4 35.0 40 30 50 21.7 16.3 27.1 53003 48227 57779 Alpine County CA est14_CA.txt 06NOV2015 +06 5 4313 3381 5245 12.9 10.1 15.7 1032 801 1263 18.6 14.4 22.8 700 537 863 16.8 12.9 20.7 54610 49602 59618 Amador County CA est14_CA.txt 06NOV2015 +06 7 48151 44057 52245 21.9 20.0 23.8 10825 9111 12539 24.3 20.4 28.2 7829 6594 9064 24.2 20.4 28.0 42302 40264 44340 Butte County CA est14_CA.txt 06NOV2015 +06 9 6057 4889 7225 13.7 11.1 16.3 1577 1219 1935 20.6 15.9 25.3 1091 839 1343 18.5 14.2 22.8 53321 48734 57908 Calaveras County CA est14_CA.txt 06NOV2015 +06 11 3030 2458 3602 14.3 11.6 17.0 1176 930 1422 19.9 15.8 24.0 812 635 989 18.7 14.6 22.8 48006 44053 51959 Colusa County CA est14_CA.txt 06NOV2015 +06 13 115466 106262 124670 10.5 9.7 11.3 35640 31659 39621 13.8 12.3 15.3 25628 22795 28461 13.3 11.8 14.8 80338 78400 82276 Contra Costa County CA est14_CA.txt 06NOV2015 +06 15 5388 4271 6505 22.4 17.8 27.0 1743 1348 2138 31.0 24.0 38.0 1174 900 1448 28.9 22.2 35.6 41419 38181 44657 Del Norte County CA est14_CA.txt 06NOV2015 +06 17 20715 18116 23314 11.4 10.0 12.8 4956 4049 5863 13.1 10.7 15.5 3405 2765 4045 11.5 9.3 13.7 70235 65699 74771 El Dorado County CA est14_CA.txt 06NOV2015 +06 19 261387 248776 273998 27.5 26.2 28.8 104770 98420 111120 38.0 35.7 40.3 71200 66789 75611 36.3 34.0 38.6 43338 41508 45168 Fresno County CA est14_CA.txt 06NOV2015 +06 21 4723 3796 5650 17.1 13.7 20.5 1751 1344 2158 23.7 18.2 29.2 1260 973 1547 23.3 18.0 28.6 43755 39548 47962 Glenn County CA est14_CA.txt 06NOV2015 +06 23 27609 24659 30559 21.0 18.8 23.2 6137 5015 7259 23.9 19.5 28.3 4240 3438 5042 23.1 18.7 27.5 40581 38005 43157 Humboldt County CA est14_CA.txt 06NOV2015 +06 25 40162 34718 45606 23.6 20.4 26.8 15870 13119 18621 31.3 25.9 36.7 11184 9112 13256 31.2 25.4 37.0 38737 35433 42041 Imperial County CA est14_CA.txt 06NOV2015 +06 27 2533 2032 3034 14.0 11.2 16.8 761 584 938 20.2 15.5 24.9 494 367 621 18.6 13.8 23.4 49267 44287 54247 Inyo County CA est14_CA.txt 06NOV2015 +06 29 206604 196231 216977 24.5 23.3 25.7 83543 78485 88601 32.9 30.9 34.9 57763 53963 61563 31.9 29.8 34.0 47451 45276 49626 Kern County CA est14_CA.txt 06NOV2015 +06 31 33174 29471 36877 24.9 22.1 27.7 13840 12443 15237 33.8 30.4 37.2 9448 8406 10490 32.4 28.8 36.0 44490 40932 48048 Kings County CA est14_CA.txt 06NOV2015 +06 33 15387 13523 17251 24.3 21.4 27.2 4119 3331 4907 32.3 26.1 38.5 2974 2425 3523 32.8 26.7 38.9 36333 33116 39550 Lake County CA est14_CA.txt 06NOV2015 +06 35 4473 3526 5420 19.4 15.3 23.5 1069 827 1311 20.3 15.7 24.9 717 552 882 18.7 14.4 23.0 49995 45570 54420 Lassen County CA est14_CA.txt 06NOV2015 +06 37 1863025 1823807 1902243 18.7 18.3 19.1 605129 588089 622169 26.7 25.9 27.5 429259 415920 442598 26.4 25.6 27.2 55686 55165 56207 Los Angeles County CA est14_CA.txt 06NOV2015 +06 39 32542 27824 37260 22.3 19.1 25.5 12871 10728 15014 30.7 25.6 35.8 8619 7014 10224 28.4 23.1 33.7 43171 40100 46242 Madera County CA est14_CA.txt 06NOV2015 +06 41 22272 19261 25283 8.8 7.6 10.0 5357 4413 6301 10.1 8.3 11.9 3467 2767 4167 8.6 6.9 10.3 94549 88283 100815 Marin County CA est14_CA.txt 06NOV2015 +06 43 2830 2225 3435 16.2 12.7 19.7 726 554 898 25.0 19.1 30.9 518 393 643 24.3 18.4 30.2 47781 44401 51161 Mariposa County CA est14_CA.txt 06NOV2015 +06 45 16256 13710 18802 18.8 15.9 21.7 4924 3897 5951 26.2 20.7 31.7 3270 2522 4018 24.5 18.9 30.1 42840 40000 45680 Mendocino County CA est14_CA.txt 06NOV2015 +06 47 64585 59569 69601 24.8 22.9 26.7 28341 25868 30814 35.9 32.8 39.0 18269 16248 20290 31.8 28.3 35.3 43818 41284 46352 Merced County CA est14_CA.txt 06NOV2015 +06 49 1770 1376 2164 20.2 15.7 24.7 544 420 668 31.3 24.1 38.5 369 280 458 28.3 21.5 35.1 39172 35813 42531 Modoc County CA est14_CA.txt 06NOV2015 +06 51 1558 1199 1917 11.3 8.7 13.9 440 337 543 16.2 12.4 20.0 307 233 381 15.3 11.6 19.0 59181 53608 64754 Mono County CA est14_CA.txt 06NOV2015 +06 53 70259 63656 76862 17.0 15.4 18.6 28122 25152 31092 25.2 22.5 27.9 18945 16774 21116 24.1 21.3 26.9 57428 55347 59509 Monterey County CA est14_CA.txt 06NOV2015 +06 55 12317 10207 14427 9.0 7.5 10.5 3660 2849 4471 12.0 9.3 14.7 2558 1963 3153 11.2 8.6 13.8 71063 66853 75273 Napa County CA est14_CA.txt 06NOV2015 +06 57 11193 9085 13301 11.4 9.2 13.6 3043 2413 3673 17.6 14.0 21.2 2164 1715 2613 16.6 13.2 20.0 57118 52704 61532 Nevada County CA est14_CA.txt 06NOV2015 +06 59 400252 381547 418957 12.9 12.3 13.5 126952 118534 135370 17.9 16.7 19.1 89899 83584 96214 17.3 16.1 18.5 76061 74857 77265 Orange County CA est14_CA.txt 06NOV2015 +06 61 30490 27114 33866 8.3 7.4 9.2 8188 6799 9577 9.7 8.1 11.3 5108 4039 6177 8.0 6.3 9.7 75689 73005 78373 Placer County CA est14_CA.txt 06NOV2015 +06 63 2556 2009 3103 14.0 11.0 17.0 679 521 837 21.6 16.6 26.6 468 355 581 20.2 15.3 25.1 47964 43161 52767 Plumas County CA est14_CA.txt 06NOV2015 +06 65 392706 372020 413392 17.1 16.2 18.0 141970 132470 151470 23.5 21.9 25.1 100349 93270 107428 22.5 20.9 24.1 56877 56024 57730 Riverside County CA est14_CA.txt 06NOV2015 +06 67 264955 251180 278730 18.1 17.2 19.0 84938 78336 91540 23.8 21.9 25.7 57267 52354 62180 22.2 20.3 24.1 55803 54725 56881 Sacramento County CA est14_CA.txt 06NOV2015 +06 69 8162 6885 9439 14.1 11.9 16.3 3056 2540 3572 19.8 16.5 23.1 2055 1681 2429 17.8 14.6 21.0 68166 63835 72497 San Benito County CA est14_CA.txt 06NOV2015 +06 71 422405 403202 441608 20.4 19.5 21.3 159554 150886 168222 28.2 26.7 29.7 113001 106473 119529 27.4 25.8 29.0 51951 51101 52801 San Bernardino County CA est14_CA.txt 06NOV2015 +06 73 467248 448710 485786 14.7 14.1 15.3 135884 127529 144239 18.9 17.7 20.1 93941 87441 100441 18.6 17.3 19.9 66034 65066 67002 San Diego County CA est14_CA.txt 06NOV2015 +06 75 101313 94708 107918 12.1 11.3 12.9 15224 12388 18060 13.6 11.1 16.1 11094 9016 13172 15.2 12.3 18.1 83788 81114 86462 San Francisco County CA est14_CA.txt 06NOV2015 +06 77 145167 135863 154471 20.7 19.4 22.0 53907 49345 58469 27.5 25.2 29.8 38015 34616 41414 26.5 24.1 28.9 51527 50269 52785 San Joaquin County CA est14_CA.txt 06NOV2015 +06 79 38048 33782 42314 14.5 12.9 16.1 7765 6329 9201 15.6 12.7 18.5 5259 4194 6324 14.5 11.6 17.4 61775 58599 64951 San Luis Obispo County CA est14_CA.txt 06NOV2015 +06 81 56580 50164 62996 7.5 6.6 8.4 15725 13131 18319 9.8 8.2 11.4 10911 9014 12808 9.5 7.8 11.2 100806 99503 102109 San Mateo County CA est14_CA.txt 06NOV2015 +06 83 73600 67362 79838 17.4 15.9 18.9 21781 19117 24445 22.6 19.8 25.4 14859 12972 16746 21.7 18.9 24.5 62116 59007 65225 Santa Barbara County CA est14_CA.txt 06NOV2015 +06 85 159553 146664 172442 8.5 7.8 9.2 40118 34171 46065 9.3 7.9 10.7 27769 23521 32017 8.9 7.5 10.3 97219 95336 99102 Santa Clara County CA est14_CA.txt 06NOV2015 +06 87 42076 37951 46201 16.1 14.5 17.7 10217 8573 11861 19.1 16.0 22.2 7149 5982 8316 18.6 15.6 21.6 64257 59903 68611 Santa Cruz County CA est14_CA.txt 06NOV2015 +06 89 26016 22460 29572 14.7 12.7 16.7 7682 5893 9471 20.3 15.6 25.0 5411 4116 6706 19.7 15.0 24.4 43661 41361 45961 Shasta County CA est14_CA.txt 06NOV2015 +06 91 409 314 504 13.8 10.6 17.0 88 67 109 19.0 14.5 23.5 60 45 75 16.7 12.6 20.8 47293 42283 52303 Sierra County CA est14_CA.txt 06NOV2015 +06 93 9076 7936 10216 21.1 18.5 23.7 2646 2170 3122 30.3 24.8 35.8 1811 1456 2166 28.4 22.8 34.0 38641 35758 41524 Siskiyou County CA est14_CA.txt 06NOV2015 +06 95 51638 45698 57578 12.3 10.9 13.7 16144 13601 18687 16.5 13.9 19.1 10742 8906 12578 15.0 12.4 17.6 67106 63857 70355 Solano County CA est14_CA.txt 06NOV2015 +06 97 55742 50076 61408 11.3 10.1 12.5 13770 11378 16162 13.6 11.2 16.0 9529 7771 11287 12.7 10.3 15.1 66949 64082 69816 Sonoma County CA est14_CA.txt 06NOV2015 +06 99 95456 86552 104360 18.1 16.4 19.8 34198 30197 38199 23.8 21.0 26.6 23015 19904 26126 22.0 19.0 25.0 50917 49680 52154 Stanislaus County CA est14_CA.txt 06NOV2015 +06 101 14485 11860 17110 15.2 12.4 18.0 5200 4022 6378 20.8 16.1 25.5 3584 2735 4433 19.3 14.7 23.9 51827 48680 54974 Sutter County CA est14_CA.txt 06NOV2015 +06 103 11358 9200 13516 18.2 14.7 21.7 3956 3041 4871 26.7 20.5 32.9 2703 2044 3362 24.8 18.8 30.8 40782 37503 44061 Tehama County CA est14_CA.txt 06NOV2015 +06 105 2577 2002 3152 19.9 15.5 24.3 684 522 846 31.7 24.2 39.2 464 351 577 30.8 23.3 38.3 34961 31947 37975 Trinity County CA est14_CA.txt 06NOV2015 +06 107 127305 118339 136271 28.1 26.1 30.1 52542 47523 57561 36.7 33.2 40.2 37023 33259 40787 36.1 32.4 39.8 42360 40429 44291 Tulare County CA est14_CA.txt 06NOV2015 +06 109 7177 5823 8531 14.3 11.6 17.0 1813 1392 2234 20.5 15.7 25.3 1239 944 1534 18.9 14.4 23.4 49476 45216 53736 Tuolumne County CA est14_CA.txt 06NOV2015 +06 111 95912 86338 105486 11.5 10.4 12.6 31764 27476 36052 15.8 13.7 17.9 21410 18281 24539 14.5 12.4 16.6 74967 73152 76782 Ventura County CA est14_CA.txt 06NOV2015 +06 113 39493 36197 42789 19.5 17.9 21.1 7788 6415 9161 17.5 14.4 20.6 5304 4297 6311 16.4 13.3 19.5 54509 51187 57831 Yolo County CA est14_CA.txt 06NOV2015 +06 115 15693 13360 18026 21.6 18.4 24.8 5802 4777 6827 28.6 23.6 33.6 3802 3006 4598 26.6 21.0 32.2 41403 37739 45067 Yuba County CA est14_CA.txt 06NOV2015 diff --git a/poverty/est14_WA.txt b/poverty/est14_WA.txt new file mode 100644 index 0000000..77bb19a --- /dev/null +++ b/poverty/est14_WA.txt @@ -0,0 +1,40 @@ +53 0 913463 895355 931571 13.2 12.9 13.5 275662 265882 285442 17.5 16.9 18.1 180464 171990 188938 16.0 15.2 16.8 61358 60882 61834 85453 80800 90106 19.6 18.5 20.7 Washington WA est14_WA.txt 06NOV2015 +53 1 3598 2947 4249 19.0 15.6 22.4 1816 1477 2155 27.1 22.0 32.2 1152 903 1401 24.7 19.4 30.0 47423 42474 52372 Adams County WA est14_WA.txt 06NOV2015 +53 3 3573 2849 4297 16.3 13.0 19.6 1104 846 1362 24.2 18.5 29.9 723 546 900 21.5 16.2 26.8 44055 39944 48166 Asotin County WA est14_WA.txt 06NOV2015 +53 5 26893 23628 30158 14.6 12.8 16.4 10421 8839 12003 21.3 18.1 24.5 6754 5615 7893 19.0 15.8 22.2 58750 56072 61428 Benton County WA est14_WA.txt 06NOV2015 +53 7 10298 8470 12126 14.0 11.5 16.5 3588 2774 4402 20.2 15.6 24.8 2436 1839 3033 19.2 14.5 23.9 49174 45028 53320 Chelan County WA est14_WA.txt 06NOV2015 +53 9 11518 9848 13188 16.2 13.8 18.6 3267 2671 3863 26.2 21.4 31.0 2025 1593 2457 22.3 17.5 27.1 47185 43543 50827 Clallam County WA est14_WA.txt 06NOV2015 +53 11 44213 38703 49723 9.9 8.7 11.1 15179 12259 18099 13.6 11.0 16.2 10647 8436 12858 12.8 10.2 15.4 61747 60396 63098 Clark County WA est14_WA.txt 06NOV2015 +53 13 607 469 745 15.5 12.0 19.0 190 145 235 25.7 19.6 31.8 130 98 162 22.0 16.6 27.4 45465 41255 49675 Columbia County WA est14_WA.txt 06NOV2015 +53 15 20701 18425 22977 20.6 18.3 22.9 6118 5100 7136 26.8 22.3 31.3 3909 3166 4652 23.1 18.7 27.5 44235 41355 47115 Cowlitz County WA est14_WA.txt 06NOV2015 +53 17 6120 4978 7262 15.5 12.6 18.4 2507 1974 3040 24.4 19.2 29.6 1712 1339 2085 22.7 17.8 27.6 51151 47257 55045 Douglas County WA est14_WA.txt 06NOV2015 +53 19 1700 1392 2008 22.4 18.3 26.5 403 316 490 29.1 22.8 35.4 264 205 323 25.9 20.1 31.7 39992 36038 43946 Ferry County WA est14_WA.txt 06NOV2015 +53 21 14661 12404 16918 17.3 14.6 20.0 7214 6027 8401 24.9 20.8 29.0 4533 3611 5455 22.4 17.8 27.0 55006 51191 58821 Franklin County WA est14_WA.txt 06NOV2015 +53 23 310 240 380 14.2 11.0 17.4 91 70 112 20.7 15.8 25.6 60 45 75 17.4 13.1 21.7 46404 41508 51300 Garfield County WA est14_WA.txt 06NOV2015 +53 25 14508 11796 17220 15.8 12.8 18.8 5766 4441 7091 20.9 16.1 25.7 3918 2983 4853 20.0 15.2 24.8 50388 47611 53165 Grant County WA est14_WA.txt 06NOV2015 +53 27 13322 11257 15387 19.6 16.6 22.6 4146 3376 4916 28.6 23.3 33.9 2760 2199 3321 26.3 21.0 31.6 43205 40965 45445 Grays Harbor County WA est14_WA.txt 06NOV2015 +53 29 7964 6639 9289 10.3 8.6 12.0 2267 1801 2733 15.4 12.2 18.6 1514 1190 1838 14.7 11.6 17.8 59358 55827 62889 Island County WA est14_WA.txt 06NOV2015 +53 31 4183 3445 4921 14.1 11.6 16.6 972 770 1174 24.5 19.4 29.6 643 502 784 21.8 17.0 26.6 50964 46641 55287 Jefferson County WA est14_WA.txt 06NOV2015 +53 33 230750 218081 243419 11.3 10.7 11.9 58351 52757 63945 13.6 12.3 14.9 38527 34470 42584 12.8 11.5 14.1 75738 74417 77059 King County WA est14_WA.txt 06NOV2015 +53 35 27550 23819 31281 11.2 9.7 12.7 7473 6103 8843 14.4 11.8 17.0 4593 3607 5579 12.2 9.6 14.8 61898 59584 64212 Kitsap County WA est14_WA.txt 06NOV2015 +53 37 7459 6329 8589 18.6 15.8 21.4 1410 1105 1715 18.7 14.7 22.7 953 742 1164 17.6 13.7 21.5 48127 44926 51328 Kittitas County WA est14_WA.txt 06NOV2015 +53 39 3029 2365 3693 14.6 11.4 17.8 935 713 1157 22.6 17.2 28.0 641 481 801 20.9 15.7 26.1 49348 44723 53973 Klickitat County WA est14_WA.txt 06NOV2015 +53 41 12695 10463 14927 17.1 14.1 20.1 3912 3075 4749 24.5 19.3 29.7 2600 2017 3183 22.3 17.3 27.3 44243 40710 47776 Lewis County WA est14_WA.txt 06NOV2015 +53 43 1274 1002 1546 12.5 9.8 15.2 392 303 481 17.7 13.7 21.7 269 207 331 15.7 12.1 19.3 49955 45180 54730 Lincoln County WA est14_WA.txt 06NOV2015 +53 45 9040 7636 10444 15.6 13.2 18.0 2660 2093 3227 23.6 18.6 28.6 1805 1406 2204 22.4 17.4 27.4 52313 49305 55321 Mason County WA est14_WA.txt 06NOV2015 +53 47 9427 8024 10830 23.2 19.8 26.6 2969 2411 3527 31.5 25.6 37.4 1992 1578 2406 29.5 23.4 35.6 37782 34745 40819 Okanogan County WA est14_WA.txt 06NOV2015 +53 49 3606 2929 4283 17.8 14.5 21.1 965 775 1155 28.8 23.1 34.5 674 538 810 28.0 22.4 33.6 40189 36441 43937 Pacific County WA est14_WA.txt 06NOV2015 +53 51 2868 2398 3338 22.3 18.6 26.0 842 665 1019 33.1 26.2 40.0 588 463 713 30.2 23.8 36.6 42579 38373 46785 Pend Oreille County WA est14_WA.txt 06NOV2015 +53 53 106432 97890 114974 13.1 12.1 14.1 34165 30111 38219 17.5 15.4 19.6 22439 19462 25416 16.2 14.1 18.3 60397 58946 61848 Pierce County WA est14_WA.txt 06NOV2015 +53 55 2018 1729 2307 12.7 10.9 14.5 437 351 523 19.6 15.7 23.5 290 227 353 16.7 13.1 20.3 54721 50513 58929 San Juan County WA est14_WA.txt 06NOV2015 +53 57 18627 16409 20845 15.7 13.8 17.6 6124 5231 7017 23.2 19.8 26.6 3765 3106 4424 19.8 16.3 23.3 51395 48709 54081 Skagit County WA est14_WA.txt 06NOV2015 +53 59 1421 1099 1743 12.6 9.7 15.5 467 353 581 20.1 15.2 25.0 316 235 397 17.5 13.0 22.0 52673 47473 57873 Skamania County WA est14_WA.txt 06NOV2015 +53 61 73930 66931 80929 9.9 9.0 10.8 22598 19490 25706 13.1 11.3 14.9 14401 12105 16697 11.5 9.7 13.3 71890 70201 73579 Snohomish County WA est14_WA.txt 06NOV2015 +53 63 76910 70461 83359 16.3 14.9 17.7 21892 18858 24926 20.5 17.7 23.3 13976 11760 16192 18.2 15.3 21.1 50083 48190 51976 Spokane County WA est14_WA.txt 06NOV2015 +53 65 8368 7255 9481 19.3 16.7 21.9 2668 2169 3167 28.2 22.9 33.5 1773 1413 2133 24.5 19.5 29.5 43823 40849 46797 Stevens County WA est14_WA.txt 06NOV2015 +53 67 31197 27796 34598 11.9 10.6 13.2 9031 7502 10560 15.6 13.0 18.2 5706 4551 6861 13.7 10.9 16.5 61653 59047 64259 Thurston County WA est14_WA.txt 06NOV2015 +53 69 558 431 685 13.9 10.7 17.1 184 141 227 26.7 20.4 33.0 130 98 162 24.3 18.3 30.3 51022 48377 53667 Wahkiakum County WA est14_WA.txt 06NOV2015 +53 71 8682 7030 10334 15.7 12.7 18.7 2654 2046 3262 20.8 16.0 25.6 1762 1341 2183 19.1 14.6 23.6 49819 46459 53179 Walla Walla County WA est14_WA.txt 06NOV2015 +53 73 31842 28461 35223 15.7 14.0 17.4 7304 6146 8462 17.7 14.9 20.5 4888 4054 5722 16.4 13.6 19.2 53733 51153 56313 Whatcom County WA est14_WA.txt 06NOV2015 +53 75 11567 10634 12500 28.4 26.1 30.7 1181 938 1424 16.7 13.3 20.1 704 529 879 14.6 11.0 18.2 41837 37907 45767 Whitman County WA est14_WA.txt 06NOV2015 +53 77 50044 45009 55079 20.5 18.4 22.6 22000 19457 24543 30.3 26.8 33.8 14492 12596 16388 28.0 24.3 31.7 44342 42101 46583 Yakima County WA est14_WA.txt 06NOV2015 diff --git a/poverty/poverty.rb b/poverty/poverty.rb new file mode 100644 index 0000000..23d9214 --- /dev/null +++ b/poverty/poverty.rb @@ -0,0 +1,28 @@ +@file_WA = File.open('est14_WA.txt') +@file_CA = File.open('est14_WA.txt') + +data_array = [] + @file_WA.each do |line| + data_array.push(line) + end + + d = data_array[1].split(' ') + + if d[76..80] == "32.2" + puts d[23] + end + puts d[2] + puts d.class + puts d[23..24].join(' ') + + +def highest_percent_poverty + percent_array = [] + @file_WA.each do |line| + percent_array.push(line.slice(76..80)) + end + return percent_array.max +end + +# puts highest_percent_poverty +# puts find_county From 67bb76629c2a7692e90ea061dd6347d51269a912 Mon Sep 17 00:00:00 2001 From: Rebecca Tolmach Date: Thu, 7 Apr 2016 10:16:30 -0700 Subject: [PATCH 2/8] created county class. printing highest poverty info --- poverty/poverty.rb | 74 +++++++++++++++++++++++++++++++++++----------- 1 file changed, 57 insertions(+), 17 deletions(-) diff --git a/poverty/poverty.rb b/poverty/poverty.rb index 23d9214..28a7095 100644 --- a/poverty/poverty.rb +++ b/poverty/poverty.rb @@ -1,28 +1,68 @@ -@file_WA = File.open('est14_WA.txt') -@file_CA = File.open('est14_WA.txt') +class County + attr_accessor :name, :percent, :num, :median_income -data_array = [] - @file_WA.each do |line| - data_array.push(line) + def initialize(name, percent, num, median_income) + @name = name + @percent = percent.to_f + @num = num.to_i + @median_income = median_income.to_i end - d = data_array[1].split(' ') - - if d[76..80] == "32.2" - puts d[23] + def self.all_counties + file_WA = File.open('est14_WA.txt') + data_array = [] + file_WA.each do |line| + data_array.push(County.new(line[193..237], line[76..79], line[49..56], line[133..138])) + end + return data_array end - puts d[2] - puts d.class - puts d[23..24].join(' ') + # puts self.all_counties[3].name + # puts self.all_counties[3].percent + # puts self.all_counties[3].num + # puts self.all_counties[3].median_income + def self.find_highest_pov + highest = 0 + county_name = "" + all_counties.each do |county| + if county.percent > highest + highest = county.percent + county_name = county.name + end + end + return "highest is #{highest} and the name is #{county_name}" -def highest_percent_poverty - percent_array = [] - @file_WA.each do |line| - percent_array.push(line.slice(76..80)) end - return percent_array.max + puts self.find_highest_pov + end + +# @file_WA = File.read('est14_WA.txt') +# @file_CA = File.read('est14_WA.txt') +# +# data_array = [] +# @file_WA.each do |line| +# data_array.push(line) +# end +# +# d = data_array[1].split(' ') +# +# if d[76..80] == "32.2" +# puts d[23] +# end +# puts d[2] +# puts d.class +# puts d[23..24].join(' ') + + +# def highest_percent_poverty +# percent_array = [] +# @file_WA.each do |line| +# percent_array.push(line.slice(76..80)) +# end +# return percent_array.max +# end + # puts highest_percent_poverty # puts find_county From c0fc2ab35c30f5c6246f7c526939128562f75688 Mon Sep 17 00:00:00 2001 From: Rebecca Tolmach Date: Thu, 7 Apr 2016 10:45:13 -0700 Subject: [PATCH 3/8] finding lowest and higest poverty in WA --- poverty/poverty.rb | 59 +++++++++++++++++----------------------------- 1 file changed, 22 insertions(+), 37 deletions(-) diff --git a/poverty/poverty.rb b/poverty/poverty.rb index 28a7095..2ee68b1 100644 --- a/poverty/poverty.rb +++ b/poverty/poverty.rb @@ -12,57 +12,42 @@ def self.all_counties file_WA = File.open('est14_WA.txt') data_array = [] file_WA.each do |line| - data_array.push(County.new(line[193..237], line[76..79], line[49..56], line[133..138])) + data_array.push(County.new(line[193..217], line[76..79], line[49..56], line[133..138])) end return data_array end - # puts self.all_counties[3].name - # puts self.all_counties[3].percent - # puts self.all_counties[3].num - # puts self.all_counties[3].median_income def self.find_highest_pov highest = 0 county_name = "" + count = 0 + income = 0 all_counties.each do |county| if county.percent > highest highest = county.percent county_name = county.name + count = county.num + income = county.median_income end end - return "highest is #{highest} and the name is #{county_name}" - + return "#{highest}% poverty in #{county_name}. Count is #{count} and median income is $#{income}" end puts self.find_highest_pov + def self.find_lowest_pov + lowest = 100 + county_name = "" + count = 0 + income = 0 + all_counties.each do |county| + if county.percent < lowest + lowest = county.percent + county_name = county.name + count = county.num + income = county.median_income + end + end + return "#{lowest}% poverty in #{county_name}. Count is #{count} and median income is $#{income}" + end + puts self.find_lowest_pov end - - -# @file_WA = File.read('est14_WA.txt') -# @file_CA = File.read('est14_WA.txt') -# -# data_array = [] -# @file_WA.each do |line| -# data_array.push(line) -# end -# -# d = data_array[1].split(' ') -# -# if d[76..80] == "32.2" -# puts d[23] -# end -# puts d[2] -# puts d.class -# puts d[23..24].join(' ') - - -# def highest_percent_poverty -# percent_array = [] -# @file_WA.each do |line| -# percent_array.push(line.slice(76..80)) -# end -# return percent_array.max -# end - -# puts highest_percent_poverty -# puts find_county From 8d1a346493f77ed71f6ed0f1f007bb986279f891 Mon Sep 17 00:00:00 2001 From: Rebecca Tolmach Date: Thu, 7 Apr 2016 11:30:30 -0700 Subject: [PATCH 4/8] finished part 1 of poverty data --- poverty/poverty.rb | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/poverty/poverty.rb b/poverty/poverty.rb index 2ee68b1..85ffb2d 100644 --- a/poverty/poverty.rb +++ b/poverty/poverty.rb @@ -9,9 +9,15 @@ def initialize(name, percent, num, median_income) end def self.all_counties - file_WA = File.open('est14_WA.txt') + puts "Choose a state: WA or CA: " + @state = gets.chomp.upcase + if @state == "WA" + file = File.open('est14_WA.txt') + elsif @state == "CA" + file = File.open('est14_CA.txt') + end data_array = [] - file_WA.each do |line| + file.each do |line| data_array.push(County.new(line[193..217], line[76..79], line[49..56], line[133..138])) end return data_array @@ -30,9 +36,8 @@ def self.find_highest_pov income = county.median_income end end - return "#{highest}% poverty in #{county_name}. Count is #{count} and median income is $#{income}" + puts "#{highest}% poverty in #{county_name} is the highest in #{@state}. #{count} people live in poverty and the median income is $#{income}" end - puts self.find_highest_pov def self.find_lowest_pov lowest = 100 @@ -47,7 +52,9 @@ def self.find_lowest_pov income = county.median_income end end - return "#{lowest}% poverty in #{county_name}. Count is #{count} and median income is $#{income}" + puts "#{lowest}% poverty in #{county_name} is the lowest in #{@state}. #{count} people live in poverty and the median income is $#{income}" end - puts self.find_lowest_pov + + self.find_highest_pov + self.find_lowest_pov end From 598d2628d9f36dc71f75aff91b8bd96702a13959 Mon Sep 17 00:00:00 2001 From: Rebecca Tolmach Date: Thu, 7 Apr 2016 12:20:50 -0700 Subject: [PATCH 5/8] search by county working --- poverty/poverty.rb | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/poverty/poverty.rb b/poverty/poverty.rb index 85ffb2d..fc296ce 100644 --- a/poverty/poverty.rb +++ b/poverty/poverty.rb @@ -2,7 +2,7 @@ class County attr_accessor :name, :percent, :num, :median_income def initialize(name, percent, num, median_income) - @name = name + @name = name.strip @percent = percent.to_f @num = num.to_i @median_income = median_income.to_i @@ -23,6 +23,16 @@ def self.all_counties return data_array end + def self.find_by_county + print "Search by counties in #{@state}. Type in a county: " + county_input = gets.chomp.downcase + all_counties.each do |county| + if county.name.strip.downcase == county_input + puts "There is #{county.percent}% poverty in #{county.name}. That amounts to #{county.num} people. The median income in #{county.median_income}" + end + end + end + def self.find_highest_pov highest = 0 county_name = "" @@ -55,6 +65,7 @@ def self.find_lowest_pov puts "#{lowest}% poverty in #{county_name} is the lowest in #{@state}. #{count} people live in poverty and the median income is $#{income}" end - self.find_highest_pov - self.find_lowest_pov + self.find_by_county + # self.find_highest_pov + # self.find_lowest_pov end From 50aad0420212b4c6f43ce64af99318a12590a6c3 Mon Sep 17 00:00:00 2001 From: Rebecca Tolmach Date: Thu, 7 Apr 2016 15:35:36 -0700 Subject: [PATCH 6/8] terminal interaction working for finding county --- poverty/poverty.rb | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/poverty/poverty.rb b/poverty/poverty.rb index fc296ce..8c728e4 100644 --- a/poverty/poverty.rb +++ b/poverty/poverty.rb @@ -9,12 +9,14 @@ def initialize(name, percent, num, median_income) end def self.all_counties - puts "Choose a state: WA or CA: " + print "Choose a state: WA or CA: " @state = gets.chomp.upcase if @state == "WA" file = File.open('est14_WA.txt') elsif @state == "CA" file = File.open('est14_CA.txt') + else + abort("see ya!") end data_array = [] file.each do |line| @@ -24,13 +26,21 @@ def self.all_counties end def self.find_by_county - print "Search by counties in #{@state}. Type in a county: " - county_input = gets.chomp.downcase - all_counties.each do |county| - if county.name.strip.downcase == county_input - puts "There is #{county.percent}% poverty in #{county.name}. That amounts to #{county.num} people. The median income in #{county.median_income}" + @match = false + while @match == false + print "Search by counties in California or Washington. Type in a county: " + county_input = gets.chomp.downcase + if county_input == "q" || county_input == "quit" + return puts "Goodbye" + else + all_counties.each do |county| + if county.name.downcase.include?(county_input) + @match = true + puts "There is #{county.percent}% poverty in #{county.name}. That amounts to #{county.num} people. The median income is $#{county.median_income}" + end + end + end end - end end def self.find_highest_pov From f1186158537c8c05a4eb818851cebed517f081c9 Mon Sep 17 00:00:00 2001 From: Rebecca Tolmach Date: Thu, 7 Apr 2016 15:44:20 -0700 Subject: [PATCH 7/8] fixed spacing --- poverty/poverty.rb | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/poverty/poverty.rb b/poverty/poverty.rb index 8c728e4..1f09205 100644 --- a/poverty/poverty.rb +++ b/poverty/poverty.rb @@ -27,20 +27,20 @@ def self.all_counties def self.find_by_county @match = false - while @match == false - print "Search by counties in California or Washington. Type in a county: " - county_input = gets.chomp.downcase - if county_input == "q" || county_input == "quit" - return puts "Goodbye" - else - all_counties.each do |county| - if county.name.downcase.include?(county_input) - @match = true - puts "There is #{county.percent}% poverty in #{county.name}. That amounts to #{county.num} people. The median income is $#{county.median_income}" - end + while @match == false + print "Search by counties in California or Washington. Type in a county: " + county_input = gets.chomp.downcase + if county_input == "q" || county_input == "quit" + return puts "Goodbye" + else + all_counties.each do |county| + if county.name.downcase.include?(county_input) + @match = true + puts "There is #{county.percent}% poverty in #{county.name}. That amounts to #{county.num} people. The median income is $#{county.median_income}" end end end + end end def self.find_highest_pov From 9fbfeafbd7e89dfe10885653a0cb00512597a7be Mon Sep 17 00:00:00 2001 From: Rebecca Tolmach Date: Sun, 10 Apr 2016 22:09:51 -0700 Subject: [PATCH 8/8] printing lowest and highest poverty rates --- poverty/poverty.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 poverty/poverty.py diff --git a/poverty/poverty.py b/poverty/poverty.py new file mode 100644 index 0000000..3f0f5ff --- /dev/null +++ b/poverty/poverty.py @@ -0,0 +1,38 @@ +def highest_state_poverty(data): + highest_name = "" + highest_percent = 0 + highest_num = 0 + highest_median_income = 0 + file = open(data, 'r') + for line in file: + name = line[193:218].strip() + percent = float(line[76:80]) + num = line[49:57].strip() + median_income = line[133:139].strip() + if percent > highest_percent: + highest_percent = percent + highest_name = name + highest_num = num + highest_median_income = median_income + print "The county with the highest child poverty is %s, with %s percent. That amounts to %s children. The median_income for the county is $%s" % (highest_name, highest_percent, highest_num, highest_median_income) + +def lowest_state_poverty(data): + lowest_name = "" + lowest_percent = 100 + lowest_num = 0 + lowest_median_income = 0 + file = open(data, 'r') + for line in file: + name = line[193:218].strip() + percent = float(line[76:80]) + num = line[49:57].strip() + median_income = line[133:139].strip() + if percent < lowest_percent: + lowest_percent = percent + lowest_name = name + lowest_num = num + lowest_median_income = median_income + print "The county with the lowest child poverty is %s, with %s percent. That amounts to %s children. The median_income for the county is $%s" % (lowest_name, lowest_percent, lowest_num, lowest_median_income) + +print lowest_state_poverty('est14_GA.txt') +print highest_state_poverty('est14_GA.txt')