Sort Demographics Example
This example shows filtering by population and then sorting by state.
python3 sort_demographics.py Please select one of the following choices: 1. Filter records by state name 2. Filter records by total population 3. Sort by state name 4. Sort by total population 5. Reset list to all records 0. Quit Enter selection: 2 Enter the minimum population: 300000 Enter the maximum population: 500000 ================================================================================ | County | State | Ed-HS| H-Own%| # House | Pop-2020 | Pop. PSQM| -------------------------------------------------------------------------------- | Ada County | ID | 95.2 | 69.3| 173353 | 494967 | 372| | Albany County | NY | 92.1 | 56.4| 126540 | 314848 | 581| | Allen County | IN | 89.4 | 68.4| 145065 | 385410 | 540| | Anoka County | MN | 94.0 | 80.1| 128198 | 363887 | 782| | Bell County | TX | 91.0 | 54.3| 122689 | 370647 | 295| | Berks County | PA | 86.7 | 71.5| 154712 | 428849 | 480| | Boulder County | CO | 95.0 | 62.2| 127415 | 330758 | 405| | Brazoria County | TX | 87.9 | 72.1| 121523 | 372031 | 230| | Burlington Coun | NJ | 93.7 | 75.4| 166391 | 461860 | 561| | Butler County | OH | 90.6 | 68.1| 139113 | 390357 | 788| | Cameron County | TX | 67.9 | 65.9| 124605 | 421017 | 456| | Charleston Coun | SC | 91.7 | 61.6| 159195 | 408235 | 382| | Chesterfield Co | VA | 92.3 | 75.8| 124971 | 364548 | 747| | Clackamas Count | OR | 93.4 | 71.1| 157408 | 421401 | 201| | Collier County | FL | 87.1 | 73.3| 142979 | 375752 | 160| | Cumberland Coun | ME | 95.1 | 69.3| 120644 | 303069 | 337| | Cumberland Coun | NC | 91.0 | 50.7| 125427 | 334728 | 489| | Dakota County | MN | 95.1 | 74.0| 161488 | 439882 | 709| | Davis County | UT | 95.6 | 77.0| 104551 | 362679 | 1025| | Douglas County | CO | 98.1 | 79.0| 120709 | 357978 | 339| | Durham County | NC | 88.4 | 54.4| 125953 | 324833 | 935| | East Baton Roug | LA | 90.5 | 59.8| 164346 | 456781 | 966| | Escambia County | FL | 90.5 | 62.0| 120104 | 321905 | 453| | Fayette County | KY | 91.2 | 54.4| 129784 | 322570 | 1042| | Forsyth County | NC | 89.2 | 61.6| 146816 | 382590 | 859| | Galveston Count | TX | 89.0 | 67.5| 121438 | 350682 | 769| | Genesee County | MI | 90.6 | 70.0| 167902 | 406211 | 668| | Gloucester Coun | NJ | 92.9 | 80.1| 104908 | 302294 | 895| | Hamilton County | IN | 96.8 | 76.9| 119789 | 347467 | 696| | Hamilton County | TN | 89.5 | 64.0| 145213 | 366207 | 620| | Hampden County | MA | 85.8 | 61.1| 179423 | 465825 | 751| | Henrico County | VA | 91.7 | 62.7| 128464 | 334389 | 1313| | Hillsborough Co | NH | 92.1 | 66.0| 161086 | 422937 | 457| | Horry County | SC | 89.6 | 71.8| 131143 | 351029 | 237| | Howard County | MD | 95.5 | 73.2| 114170 | 332317 | 1144| | Jefferson Paris | LA | 85.7 | 61.2| 169452 | 440781 | 1463| | Knox County | TN | 91.7 | 64.3| 187319 | 478971 | 850| | Lake County | FL | 89.5 | 74.5| 134317 | 383956 | 316| | Lake County | IN | 88.7 | 69.7| 186731 | 498700 | 994| | Lancaster Count | NE | 93.7 | 59.8| 124324 | 322608 | 340| | Lane County | OR | 91.9 | 58.7| 152312 | 382971 | 77| | Larimer County | CO | 95.9 | 65.0| 137021 | 359066 | 115| | Lehigh County | PA | 89.0 | 64.4| 138714 | 374557 | 1012| | Lorain County | OH | 89.7 | 72.3| 120281 | 312964 | 613| | Loudoun County | VA | 93.9 | 78.0| 128637 | 420959 | 605| | Lubbock County | TX | 86.2 | 55.2| 113488 | 310639 | 311| | Lucas County | OH | 89.3 | 59.7| 179930 | 431279 | 1296| | Luzerne County | PA | 89.8 | 68.0| 128660 | 325594 | 360| | Madison County | AL | 91.7 | 66.8| 148189 | 388153 | 417| | Manatee County | FL | 89.7 | 72.9| 145356 | 399710 | 434| | Marion County | FL | 87.6 | 75.0| 139172 | 375908 | 209| | Marion County | OR | 85.2 | 60.2| 118038 | 345920 | 266| | McHenry County | IL | 93.1 | 79.4| 112453 | 310229 | 511| | Mercer County | NJ | 88.5 | 63.1| 129936 | 387340 | 1632| | Mobile County | AL | 86.5 | 64.5| 156251 | 414809 | 335| | Monterey County | CA | 71.5 | 51.0| 127155 | 439035 | 126| | Northampton Cou | PA | 90.9 | 71.4| 114185 | 312951 | 805| | Nueces County | TX | 82.8 | 58.0| 129451 | 353178 | 405| | Onondaga County | NY | 91.0 | 64.7| 185324 | 476516 | 600| | Orange County | NY | 89.7 | 66.9| 128016 | 401310 | 459| | Orleans Parish | LA | 86.5 | 48.3| 153819 | 383997 | 2029| | Osceola County | FL | 86.7 | 61.6| 103141 | 388656 | 202| | Pinal County | AZ | 85.8 | 76.7| 141300 | 425264 | 70| | Placer County | CA | 94.5 | 71.9| 142855 | 404739 | 247| | Polk County | IA | 91.5 | 67.1| 187798 | 492401 | 750| | Prince William | VA | 88.5 | 73.3| 142000 | 482204 | 1195| | Pulaski County | AR | 90.4 | 58.8| 158051 | 399125 | 503| | Richland County | SC | 91.5 | 59.5| 151853 | 416147 | 507| | Richmond County | NY | 88.7 | 69.3| 166246 | 495747 | 8030| | Rockingham Coun | NH | 95.1 | 77.7| 121045 | 314176 | 425| | Rockland County | NY | 88.2 | 68.3| 100438 | 338329 | 1795| | Rutherford Coun | TN | 91.8 | 65.2| 111676 | 341486 | 424| | Santa Barbara C | CA | 80.9 | 52.1| 145856 | 448229 | 155| | Sarasota County | FL | 93.1 | 74.9| 182842 | 434006 | 682| | Seminole County | FL | 94.3 | 64.6| 173668 | 470856 | 1367| | Solano County | CA | 88.4 | 61.5| 149865 | 453491 | 503| | Somerset County | NJ | 94.5 | 75.8| 118193 | 345361 | 1071| | Sonoma County | CA | 88.8 | 61.5| 189374 | 488863 | 307| | Spartanburg Cou | SC | 85.7 | 70.6| 116645 | 327997 | 351| | St. Charles Cou | MO | 94.8 | 80.6| 146631 | 405262 | 643| | St. Louis city | MO | 87.8 | 43.7| 141952 | 301578 | 5157| | St. Lucie Count | FL | 86.3 | 73.2| 114761 | 329226 | 485| | Stark County | OH | 91.6 | 68.2| 153460 | 374853 | 652| | Tulare County | CA | 70.8 | 57.1| 138238 | 473117 | 91| | Virginia Beach | VA | 93.5 | 63.7| 170798 | 459470 | 1758| | Washoe County | NV | 88.6 | 58.3| 182180 | 486492 | 66| | Washtenaw Count | MI | 95.3 | 61.1| 141245 | 372258 | 488| | Waukesha County | WI | 96.2 | 76.3| 158808 | 406978 | 709| | Weld County | CO | 88.1 | 72.9| 104671 | 328981 | 63| | Westmoreland Co | PA | 94.4 | 77.2| 152283 | 354663 | 355| | York County | PA | 89.9 | 74.9| 172421 | 456438 | 481| -------------------------------------------------------------------------------- Please select one of the following choices: 1. Filter records by state name 2. Filter records by total population 3. Sort by state name 4. Sort by total population 5. Reset list to all records 0. Quit Enter selection: 3 ================================================================================ | County | State | Ed-HS| H-Own%| # House | Pop-2020 | Pop. PSQM| -------------------------------------------------------------------------------- | Madison County | AL | 91.7 | 66.8| 148189 | 388153 | 417| | Mobile County | AL | 86.5 | 64.5| 156251 | 414809 | 335| | Pulaski County | AR | 90.4 | 58.8| 158051 | 399125 | 503| | Pinal County | AZ | 85.8 | 76.7| 141300 | 425264 | 70| | Monterey County | CA | 71.5 | 51.0| 127155 | 439035 | 126| | Placer County | CA | 94.5 | 71.9| 142855 | 404739 | 247| | Santa Barbara C | CA | 80.9 | 52.1| 145856 | 448229 | 155| | Solano County | CA | 88.4 | 61.5| 149865 | 453491 | 503| | Sonoma County | CA | 88.8 | 61.5| 189374 | 488863 | 307| | Tulare County | CA | 70.8 | 57.1| 138238 | 473117 | 91| | Boulder County | CO | 95.0 | 62.2| 127415 | 330758 | 405| | Douglas County | CO | 98.1 | 79.0| 120709 | 357978 | 339| | Larimer County | CO | 95.9 | 65.0| 137021 | 359066 | 115| | Weld County | CO | 88.1 | 72.9| 104671 | 328981 | 63| | Collier County | FL | 87.1 | 73.3| 142979 | 375752 | 160| | Escambia County | FL | 90.5 | 62.0| 120104 | 321905 | 453| | Lake County | FL | 89.5 | 74.5| 134317 | 383956 | 316| | Manatee County | FL | 89.7 | 72.9| 145356 | 399710 | 434| | Marion County | FL | 87.6 | 75.0| 139172 | 375908 | 209| | Osceola County | FL | 86.7 | 61.6| 103141 | 388656 | 202| | Sarasota County | FL | 93.1 | 74.9| 182842 | 434006 | 682| | Seminole County | FL | 94.3 | 64.6| 173668 | 470856 | 1367| | St. Lucie Count | FL | 86.3 | 73.2| 114761 | 329226 | 485| | Polk County | IA | 91.5 | 67.1| 187798 | 492401 | 750| | Ada County | ID | 95.2 | 69.3| 173353 | 494967 | 372| | McHenry County | IL | 93.1 | 79.4| 112453 | 310229 | 511| | Allen County | IN | 89.4 | 68.4| 145065 | 385410 | 540| | Hamilton County | IN | 96.8 | 76.9| 119789 | 347467 | 696| | Lake County | IN | 88.7 | 69.7| 186731 | 498700 | 994| | Fayette County | KY | 91.2 | 54.4| 129784 | 322570 | 1042| | East Baton Roug | LA | 90.5 | 59.8| 164346 | 456781 | 966| | Jefferson Paris | LA | 85.7 | 61.2| 169452 | 440781 | 1463| | Orleans Parish | LA | 86.5 | 48.3| 153819 | 383997 | 2029| | Hampden County | MA | 85.8 | 61.1| 179423 | 465825 | 751| | Howard County | MD | 95.5 | 73.2| 114170 | 332317 | 1144| | Cumberland Coun | ME | 95.1 | 69.3| 120644 | 303069 | 337| | Genesee County | MI | 90.6 | 70.0| 167902 | 406211 | 668| | Washtenaw Count | MI | 95.3 | 61.1| 141245 | 372258 | 488| | Anoka County | MN | 94.0 | 80.1| 128198 | 363887 | 782| | Dakota County | MN | 95.1 | 74.0| 161488 | 439882 | 709| | St. Charles Cou | MO | 94.8 | 80.6| 146631 | 405262 | 643| | St. Louis city | MO | 87.8 | 43.7| 141952 | 301578 | 5157| | Cumberland Coun | NC | 91.0 | 50.7| 125427 | 334728 | 489| | Durham County | NC | 88.4 | 54.4| 125953 | 324833 | 935| | Forsyth County | NC | 89.2 | 61.6| 146816 | 382590 | 859| | Lancaster Count | NE | 93.7 | 59.8| 124324 | 322608 | 340| | Hillsborough Co | NH | 92.1 | 66.0| 161086 | 422937 | 457| | Rockingham Coun | NH | 95.1 | 77.7| 121045 | 314176 | 425| | Burlington Coun | NJ | 93.7 | 75.4| 166391 | 461860 | 561| | Gloucester Coun | NJ | 92.9 | 80.1| 104908 | 302294 | 895| | Mercer County | NJ | 88.5 | 63.1| 129936 | 387340 | 1632| | Somerset County | NJ | 94.5 | 75.8| 118193 | 345361 | 1071| | Washoe County | NV | 88.6 | 58.3| 182180 | 486492 | 66| | Albany County | NY | 92.1 | 56.4| 126540 | 314848 | 581| | Onondaga County | NY | 91.0 | 64.7| 185324 | 476516 | 600| | Orange County | NY | 89.7 | 66.9| 128016 | 401310 | 459| | Richmond County | NY | 88.7 | 69.3| 166246 | 495747 | 8030| | Rockland County | NY | 88.2 | 68.3| 100438 | 338329 | 1795| | Butler County | OH | 90.6 | 68.1| 139113 | 390357 | 788| | Lorain County | OH | 89.7 | 72.3| 120281 | 312964 | 613| | Lucas County | OH | 89.3 | 59.7| 179930 | 431279 | 1296| | Stark County | OH | 91.6 | 68.2| 153460 | 374853 | 652| | Clackamas Count | OR | 93.4 | 71.1| 157408 | 421401 | 201| | Lane County | OR | 91.9 | 58.7| 152312 | 382971 | 77| | Marion County | OR | 85.2 | 60.2| 118038 | 345920 | 266| | Berks County | PA | 86.7 | 71.5| 154712 | 428849 | 480| | Lehigh County | PA | 89.0 | 64.4| 138714 | 374557 | 1012| | Luzerne County | PA | 89.8 | 68.0| 128660 | 325594 | 360| | Northampton Cou | PA | 90.9 | 71.4| 114185 | 312951 | 805| | Westmoreland Co | PA | 94.4 | 77.2| 152283 | 354663 | 355| | York County | PA | 89.9 | 74.9| 172421 | 456438 | 481| | Charleston Coun | SC | 91.7 | 61.6| 159195 | 408235 | 382| | Horry County | SC | 89.6 | 71.8| 131143 | 351029 | 237| | Richland County | SC | 91.5 | 59.5| 151853 | 416147 | 507| | Spartanburg Cou | SC | 85.7 | 70.6| 116645 | 327997 | 351| | Hamilton County | TN | 89.5 | 64.0| 145213 | 366207 | 620| | Knox County | TN | 91.7 | 64.3| 187319 | 478971 | 850| | Rutherford Coun | TN | 91.8 | 65.2| 111676 | 341486 | 424| | Bell County | TX | 91.0 | 54.3| 122689 | 370647 | 295| | Brazoria County | TX | 87.9 | 72.1| 121523 | 372031 | 230| | Cameron County | TX | 67.9 | 65.9| 124605 | 421017 | 456| | Galveston Count | TX | 89.0 | 67.5| 121438 | 350682 | 769| | Lubbock County | TX | 86.2 | 55.2| 113488 | 310639 | 311| | Nueces County | TX | 82.8 | 58.0| 129451 | 353178 | 405| | Davis County | UT | 95.6 | 77.0| 104551 | 362679 | 1025| | Chesterfield Co | VA | 92.3 | 75.8| 124971 | 364548 | 747| | Henrico County | VA | 91.7 | 62.7| 128464 | 334389 | 1313| | Loudoun County | VA | 93.9 | 78.0| 128637 | 420959 | 605| | Prince William | VA | 88.5 | 73.3| 142000 | 482204 | 1195| | Virginia Beach | VA | 93.5 | 63.7| 170798 | 459470 | 1758| | Waukesha County | WI | 96.2 | 76.3| 158808 | 406978 | 709| -------------------------------------------------------------------------------- Please select one of the following choices: 1. Filter records by state name 2. Filter records by total population 3. Sort by state name 4. Sort by total population 5. Reset list to all records 0. Quit Enter selection: 0 Goodbye!