This example shows lots of filtering, sorting and resetting.
$ python3 sort_usda.py
Please select one of the following choices:
1. Filter records by county name
2. Filter records by median income
3. Sort by population
4. Sort by poverty rate
5. Reset list to all records
0. Quit
Enter selection: 1
County name or prefix? Br
=========================================================================
| County | State |Total Pop| H.S. | Coll |Unemp |Pvrty | Income
-------------------------------------------------------------------------
| Bracken County | KY | 8446 | 88.8 | 13.0 | 4.5 | 14.8 | 55347
| Bradford County | FL | 28050 | 82.0 | 11.8 | 4.3 | 19.1 | 54911
| Bradford County | PA | 60099 | 90.2 | 19.5 | 5.3 | 13.7 | 55199
| Bradley County | AR | 10332 | 84.1 | 12.5 | 4.8 | 19.6 | 40454
| Bradley County | TN | 109769 | 87.4 | 22.9 | 4.3 | 11.7 | 56273
| Branch County | MI | 45202 | 88.9 | 15.4 | 4.9 | 12.5 | 60481
| Brantley County | GA | 18121 | 81.3 | 6.5 | 3.7 | 18.4 | 48076
| Braxton County | WV | 12293 | 82.0 | 13.8 | 6.8 | 21.3 | 41587
| Brazoria County | TX | 378858 | 88.8 | 31.3 | 6.8 | 9.0 | 82165
| Brazos County | TX | 237583 | 88.8 | 42.2 | 4.1 | 22.6 | 50494
| Breathitt Count | KY | 13527 | 77.5 | 16.9 | 8.1 | 31.0 | 33005
| Breckinridge Co | KY | 20652 | 86.1 | 14.2 | 4.9 | 16.9 | 50012
| Bremer County | IA | 25122 | 96.5 | 33.7 | 2.9 | 7.1 | 75395
| Brevard County | FL | 617742 | 92.5 | 31.7 | 4.1 | 11.3 | 65280
| Brewster County | TX | 9459 | 88.0 | 46.0 | 4.6 | 13.3 | 51197
| Briscoe County | TX | 1400 | 85.2 | 15.6 | 4.8 | 14.7 | 49905
| Bristol Bay Bor | AK | 841 | 94.8 | 22.1 | 5.6 | 11.3 | 88516
| Bristol city | VA | 17095 | 86.8 | 23.4 | 4.7 | 18.4 | 41272
| Bristol County | MA | 579895 | 85.9 | 29.3 | 6.3 | 11.9 | 72857
| Bristol County | RI | 50800 | 91.7 | 49.5 | 4.7 | 7.5 | 94553
| Broadwater Coun | MT | 7323 | 92.8 | 23.5 | 4.0 | 8.6 | 66307
| Bronx County | NY | 1421089 | 74.1 | 20.9 | 13.8 | 26.4 | 43143
| Brooke County | WV | 22109 | 92.9 | 20.5 | 6.1 | 13.0 | 52217
| Brookings Count | SD | 34710 | 96.3 | 43.0 | 2.7 | 12.6 | 61581
| Brooks County | GA | 16285 | 81.6 | 16.8 | 3.8 | 23.5 | 40936
| Brooks County | TX | 6994 | 68.5 | 18.0 | 9.1 | 28.6 | 33460
| Broome County | NY | 198703 | 90.6 | 28.9 | 5.3 | 14.1 | 55729
| Broomfield Coun | CO | 75375 | 96.6 | 57.8 | 4.6 | 4.9 | 106413
| Broward County | FL | 1935729 | 89.9 | 34.3 | 4.9 | 12.8 | 65536
| Brown County | IL | 6443 | 80.7 | 13.0 | 2.7 | 16.6 | 51294
| Brown County | IN | 15573 | 93.0 | 27.7 | 3.6 | 10.8 | 66839
| Brown County | KS | 9453 | 93.5 | 19.1 | 2.8 | 14.0 | 52446
| Brown County | MN | 25883 | 93.2 | 23.7 | 3.4 | 9.2 | 63708
| Brown County | NE | 2912 | 93.8 | 22.5 | 2.4 | 10.9 | 52738
| Brown County | OH | 43690 | 86.7 | 14.6 | 5.4 | 16.8 | 58990
| Brown County | SD | 38090 | 93.2 | 32.4 | 2.6 | 11.6 | 62070
| Brown County | TX | 38142 | 86.9 | 19.4 | 5.2 | 15.3 | 48803
| Brown County | WI | 268814 | 92.4 | 31.8 | 3.5 | 9.3 | 67232
| Brule County | SD | 5254 | 88.1 | 24.6 | 2.1 | 12.8 | 58516
| Brunswick Count | NC | 144814 | 92.9 | 31.7 | 6.1 | 9.8 | 67286
| Brunswick Count | VA | 15979 | 78.4 | 16.1 | 6.2 | 21.3 | 47401
| Bryan County | GA | 46963 | 92.3 | 33.5 | 2.9 | 8.1 | 87334
| Bryan County | OK | 47187 | 87.1 | 23.7 | 3.4 | 16.5 | 47916
-------------------------------------------------------------------------
Please select one of the following choices:
1. Filter records by county name
2. Filter records by median income
3. Sort by population
4. Sort by poverty rate
5. Reset list to all records
0. Quit
Enter selection: 2
minimum median income? 45000
maximum median income? 55000
=========================================================================
| County | State |Total Pop| H.S. | Coll |Unemp |Pvrty | Income
-------------------------------------------------------------------------
| Bradford County | FL | 28050 | 82.0 | 11.8 | 4.3 | 19.1 | 54911
| Brantley County | GA | 18121 | 81.3 | 6.5 | 3.7 | 18.4 | 48076
| Brazos County | TX | 237583 | 88.8 | 42.2 | 4.1 | 22.6 | 50494
| Breckinridge Co | KY | 20652 | 86.1 | 14.2 | 4.9 | 16.9 | 50012
| Brewster County | TX | 9459 | 88.0 | 46.0 | 4.6 | 13.3 | 51197
| Briscoe County | TX | 1400 | 85.2 | 15.6 | 4.8 | 14.7 | 49905
| Brooke County | WV | 22109 | 92.9 | 20.5 | 6.1 | 13.0 | 52217
| Brown County | IL | 6443 | 80.7 | 13.0 | 2.7 | 16.6 | 51294
| Brown County | KS | 9453 | 93.5 | 19.1 | 2.8 | 14.0 | 52446
| Brown County | NE | 2912 | 93.8 | 22.5 | 2.4 | 10.9 | 52738
| Brown County | TX | 38142 | 86.9 | 19.4 | 5.2 | 15.3 | 48803
| Brunswick Count | VA | 15979 | 78.4 | 16.1 | 6.2 | 21.3 | 47401
| Bryan County | OK | 47187 | 87.1 | 23.7 | 3.4 | 16.5 | 47916
-------------------------------------------------------------------------
Please select one of the following choices:
1. Filter records by county name
2. Filter records by median income
3. Sort by population
4. Sort by poverty rate
5. Reset list to all records
0. Quit
Enter selection: 3
=========================================================================
| County | State |Total Pop| H.S. | Coll |Unemp |Pvrty | Income
-------------------------------------------------------------------------
| Briscoe County | TX | 1400 | 85.2 | 15.6 | 4.8 | 14.7 | 49905
| Brown County | NE | 2912 | 93.8 | 22.5 | 2.4 | 10.9 | 52738
| Brown County | IL | 6443 | 80.7 | 13.0 | 2.7 | 16.6 | 51294
| Brown County | KS | 9453 | 93.5 | 19.1 | 2.8 | 14.0 | 52446
| Brewster County | TX | 9459 | 88.0 | 46.0 | 4.6 | 13.3 | 51197
| Brunswick Count | VA | 15979 | 78.4 | 16.1 | 6.2 | 21.3 | 47401
| Brantley County | GA | 18121 | 81.3 | 6.5 | 3.7 | 18.4 | 48076
| Breckinridge Co | KY | 20652 | 86.1 | 14.2 | 4.9 | 16.9 | 50012
| Brooke County | WV | 22109 | 92.9 | 20.5 | 6.1 | 13.0 | 52217
| Bradford County | FL | 28050 | 82.0 | 11.8 | 4.3 | 19.1 | 54911
| Brown County | TX | 38142 | 86.9 | 19.4 | 5.2 | 15.3 | 48803
| Bryan County | OK | 47187 | 87.1 | 23.7 | 3.4 | 16.5 | 47916
| Brazos County | TX | 237583 | 88.8 | 42.2 | 4.1 | 22.6 | 50494
-------------------------------------------------------------------------
Please select one of the following choices:
1. Filter records by county name
2. Filter records by median income
3. Sort by population
4. Sort by poverty rate
5. Reset list to all records
0. Quit
Enter selection: 1
County name or prefix? Brown
=========================================================================
| County | State |Total Pop| H.S. | Coll |Unemp |Pvrty | Income
-------------------------------------------------------------------------
| Brown County | NE | 2912 | 93.8 | 22.5 | 2.4 | 10.9 | 52738
| Brown County | IL | 6443 | 80.7 | 13.0 | 2.7 | 16.6 | 51294
| Brown County | KS | 9453 | 93.5 | 19.1 | 2.8 | 14.0 | 52446
| Brown County | TX | 38142 | 86.9 | 19.4 | 5.2 | 15.3 | 48803
-------------------------------------------------------------------------
Please select one of the following choices:
1. Filter records by county name
2. Filter records by median income
3. Sort by population
4. Sort by poverty rate
5. Reset list to all records
0. Quit
Enter selection: 4
=========================================================================
| County | State |Total Pop| H.S. | Coll |Unemp |Pvrty | Income
-------------------------------------------------------------------------
| Brown County | NE | 2912 | 93.8 | 22.5 | 2.4 | 10.9 | 52738
| Brown County | KS | 9453 | 93.5 | 19.1 | 2.8 | 14.0 | 52446
| Brown County | TX | 38142 | 86.9 | 19.4 | 5.2 | 15.3 | 48803
| Brown County | IL | 6443 | 80.7 | 13.0 | 2.7 | 16.6 | 51294
-------------------------------------------------------------------------
Please select one of the following choices:
1. Filter records by county name
2. Filter records by median income
3. Sort by population
4. Sort by poverty rate
5. Reset list to all records
0. Quit
Enter selection: 5
Records reset.
Please select one of the following choices:
1. Filter records by county name
2. Filter records by median income
3. Sort by population
4. Sort by poverty rate
5. Reset list to all records
0. Quit
Enter selection: 1
County name or prefix? X
No records found
Please select one of the following choices:
1. Filter records by county name
2. Filter records by median income
3. Sort by population
4. Sort by poverty rate
5. Reset list to all records
0. Quit
Enter selection: 1
County name or prefix? Del
No records found
Please select one of the following choices:
1. Filter records by county name
2. Filter records by median income
3. Sort by population
4. Sort by poverty rate
5. Reset list to all records
0. Quit
Enter selection: 5
Please select one of the following choices:
1. Filter records by county name
2. Filter records by median income
3. Sort by population
4. Sort by poverty rate
5. Reset list to all records
0. Quit
Enter selection: 1
County name or prefix? Del
=========================================================================
| County | State |Total Pop| H.S. | Coll |Unemp |Pvrty | Income
-------------------------------------------------------------------------
| Del Norte Count | CA | 27553 | 80.6 | 16.1 | 7.6 | 21.4 | 48108
| Delaware County | IA | 17531 | 92.2 | 18.8 | 3.0 | 9.1 | 69767
| Delaware County | IN | 111981 | 90.4 | 25.4 | 4.4 | 18.4 | 50533
| Delaware County | NY | 44753 | 90.0 | 23.0 | 4.7 | 15.9 | 53385
| Delaware County | OH | 221186 | 97.2 | 57.1 | 3.6 | 4.1 | 118661
| Delaware County | OK | 40927 | 85.2 | 18.2 | 3.5 | 18.1 | 47774
| Delaware County | PA | 576772 | 93.4 | 40.5 | 5.9 | 10.1 | 78194
| Delta County | CO | 31383 | 89.6 | 22.9 | 5.7 | 13.9 | 52403
| Delta County | MI | 36834 | 92.8 | 18.8 | 6.1 | 11.8 | 53234
| Delta County | TX | 5337 | 87.4 | 22.3 | 4.9 | 15.8 | 50329
-------------------------------------------------------------------------
Please select one of the following choices:
1. Filter records by county name
2. Filter records by median income
3. Sort by population
4. Sort by poverty rate
5. Reset list to all records
0. Quit
Enter selection: 2
minimum median income? 0
maximum median income? 30000
No records found
Please select one of the following choices:
1. Filter records by county name
2. Filter records by median income
3. Sort by population
4. Sort by poverty rate
5. Reset list to all records
0. Quit
Enter selection: 5
Please select one of the following choices:
1. Filter records by county name
2. Filter records by median income
3. Sort by population
4. Sort by poverty rate
5. Reset list to all records
0. Quit
Enter selection: 2
minimum median income? 25000
maximum median income? 35000
=========================================================================
| County | State |Total Pop| H.S. | Coll |Unemp |Pvrty | Income
-------------------------------------------------------------------------
| Allendale Count | SC | 7870 | 76.3 | 10.4 | 7.6 | 35.4 | 31262
| Bell County | KY | 23765 | 75.3 | 9.9 | 5.4 | 32.1 | 31033
| Breathitt Count | KY | 13527 | 77.5 | 16.9 | 8.1 | 31.0 | 33005
| Brooks County | TX | 6994 | 68.5 | 18.0 | 9.1 | 28.6 | 33460
| Buffalo County | SD | 1912 | 81.1 | 6.9 | 4.6 | 35.9 | 25653
| Bullock County | AL | 10280 | 77.6 | 11.7 | 3.9 | 32.1 | 32027
| Chicot County | AR | 10071 | 78.4 | 14.8 | 8.5 | 27.9 | 34857
| Claiborne Count | MS | 8898 | 81.6 | 21.3 | 11.3 | 33.3 | 33163
| Clay County | KY | 20184 | 68.3 | 11.5 | 6.4 | 35.9 | 30700
| Coahoma County | MS | 20732 | 81.2 | 18.4 | 8.4 | 37.9 | 31234
| Corson County | SD | 3843 | 86.0 | 15.5 | 4.0 | 41.9 | 34372
| Dallas County | AL | 37565 | 85.9 | 16.1 | 7.1 | 29.5 | 33159
| East Carroll Pa | LA | 7242 | 65.6 | 10.2 | 9.9 | 39.9 | 30288
| Elliott County | KY | 7375 | 75.1 | 8.9 | 7.9 | 26.6 | 34491
| Greene County | AL | 7592 | 84.5 | 12.7 | 6.5 | 33.2 | 30225
| Hall County | TX | 2845 | 82.6 | 19.3 | 5.5 | 24.1 | 34766
| Hancock County | TN | 6777 | 81.4 | 11.1 | 5.0 | 27.6 | 34055
| Harlan County | KY | 26177 | 74.9 | 9.5 | 7.9 | 33.2 | 31116
| Holmes County | MS | 16476 | 77.6 | 12.7 | 10.6 | 37.8 | 28236
| Humphreys Count | MS | 7548 | 76.3 | 18.1 | 12.2 | 33.3 | 30555
| Issaquena Count | MS | 1297 | 59.5 | 4.5 | 8.9 | 43.9 | 29050
| Jefferson Count | MS | 7156 | 78.5 | 18.1 | 15.8 | 31.7 | 32234
| Jefferson Davis | MS | 11158 | 84.4 | 13.9 | 7.5 | 25.2 | 34876
| Knott County | KY | 14033 | 70.4 | 16.0 | 6.7 | 32.0 | 34051
| Knox County | KY | 30019 | 76.1 | 15.3 | 5.9 | 35.1 | 32646
| Lake County | TN | 6597 | 73.6 | 11.5 | 6.1 | 33.4 | 29281
| Lee County | AR | 8559 | 81.8 | 9.8 | 5.7 | 34.9 | 29714
| Lee County | KY | 7454 | 73.0 | 7.9 | 5.3 | 33.5 | 29143
| Leflore County | MS | 27398 | 82.5 | 18.8 | 8.0 | 35.6 | 31091
| Leslie County | KY | 10298 | 83.5 | 9.2 | 7.5 | 29.8 | 32682
| Letcher County | KY | 21245 | 77.0 | 10.3 | 7.1 | 29.1 | 34897
| Madison Parish | LA | 9804 | 75.4 | 15.1 | 6.9 | 35.3 | 33619
| Magoffin County | KY | 11476 | 72.1 | 10.9 | 11.5 | 33.2 | 34423
| Martin County | KY | 11157 | 73.7 | 11.8 | 8.6 | 40.5 | 29387
| McCreary County | KY | 16681 | 77.9 | 7.0 | 5.5 | 33.5 | 32938
| McDowell County | WV | 18413 | 74.6 | 6.4 | 8.4 | 31.7 | 28720
| Mingo County | WV | 23094 | 75.7 | 9.0 | 8.9 | 31.1 | 33416
| Noxubee County | MS | 10114 | 77.3 | 12.2 | 8.6 | 26.8 | 34467
| Owsley County | KY | 3967 | 68.5 | 11.5 | 6.7 | 35.6 | 29365
| Perry County | AL | 8317 | 78.6 | 18.9 | 7.9 | 33.7 | 31522
| Phillips County | AR | 15822 | 81.7 | 14.3 | 7.7 | 35.7 | 32419
| Quitman County | MS | 5911 | 74.6 | 11.2 | 8.3 | 33.8 | 31877
| Randolph County | GA | 6253 | 79.1 | 12.4 | 5.2 | 28.1 | 34883
| Sharkey County | MS | 3648 | 79.8 | 17.0 | 9.0 | 35.1 | 32650
| Starr County | TX | 65972 | 58.8 | 12.3 | 15.6 | 31.6 | 33535
| Sumter County | AL | 11961 | 87.3 | 19.5 | 4.4 | 35.1 | 29490
| Sunflower Count | MS | 25328 | 76.1 | 16.1 | 8.9 | 38.7 | 34017
| Tensas Parish | LA | 4034 | 77.8 | 13.4 | 6.0 | 32.1 | 31438
| Wilcox County | AL | 10331 | 79.2 | 11.0 | 10.5 | 32.4 | 30071
| Wilkinson Count | MS | 8288 | 81.3 | 13.4 | 10.7 | 32.4 | 33777
| Wolfe County | KY | 6491 | 66.0 | 6.6 | 5.7 | 29.0 | 34749
-------------------------------------------------------------------------
Please select one of the following choices:
1. Filter records by county name
2. Filter records by median income
3. Sort by population
4. Sort by poverty rate
5. Reset list to all records
0. Quit
Enter selection: 4
=========================================================================
| County | State |Total Pop| H.S. | Coll |Unemp |Pvrty | Income
-------------------------------------------------------------------------
| Hall County | TX | 2845 | 82.6 | 19.3 | 5.5 | 24.1 | 34766
| Jefferson Davis | MS | 11158 | 84.4 | 13.9 | 7.5 | 25.2 | 34876
| Elliott County | KY | 7375 | 75.1 | 8.9 | 7.9 | 26.6 | 34491
| Noxubee County | MS | 10114 | 77.3 | 12.2 | 8.6 | 26.8 | 34467
| Hancock County | TN | 6777 | 81.4 | 11.1 | 5.0 | 27.6 | 34055
| Chicot County | AR | 10071 | 78.4 | 14.8 | 8.5 | 27.9 | 34857
| Randolph County | GA | 6253 | 79.1 | 12.4 | 5.2 | 28.1 | 34883
| Brooks County | TX | 6994 | 68.5 | 18.0 | 9.1 | 28.6 | 33460
| Wolfe County | KY | 6491 | 66.0 | 6.6 | 5.7 | 29.0 | 34749
| Letcher County | KY | 21245 | 77.0 | 10.3 | 7.1 | 29.1 | 34897
| Dallas County | AL | 37565 | 85.9 | 16.1 | 7.1 | 29.5 | 33159
| Leslie County | KY | 10298 | 83.5 | 9.2 | 7.5 | 29.8 | 32682
| Breathitt Count | KY | 13527 | 77.5 | 16.9 | 8.1 | 31.0 | 33005
| Mingo County | WV | 23094 | 75.7 | 9.0 | 8.9 | 31.1 | 33416
| Starr County | TX | 65972 | 58.8 | 12.3 | 15.6 | 31.6 | 33535
| Jefferson Count | MS | 7156 | 78.5 | 18.1 | 15.8 | 31.7 | 32234
| McDowell County | WV | 18413 | 74.6 | 6.4 | 8.4 | 31.7 | 28720
| Knott County | KY | 14033 | 70.4 | 16.0 | 6.7 | 32.0 | 34051
| Bell County | KY | 23765 | 75.3 | 9.9 | 5.4 | 32.1 | 31033
| Bullock County | AL | 10280 | 77.6 | 11.7 | 3.9 | 32.1 | 32027
| Tensas Parish | LA | 4034 | 77.8 | 13.4 | 6.0 | 32.1 | 31438
| Wilcox County | AL | 10331 | 79.2 | 11.0 | 10.5 | 32.4 | 30071
| Wilkinson Count | MS | 8288 | 81.3 | 13.4 | 10.7 | 32.4 | 33777
| Greene County | AL | 7592 | 84.5 | 12.7 | 6.5 | 33.2 | 30225
| Harlan County | KY | 26177 | 74.9 | 9.5 | 7.9 | 33.2 | 31116
| Magoffin County | KY | 11476 | 72.1 | 10.9 | 11.5 | 33.2 | 34423
| Claiborne Count | MS | 8898 | 81.6 | 21.3 | 11.3 | 33.3 | 33163
| Humphreys Count | MS | 7548 | 76.3 | 18.1 | 12.2 | 33.3 | 30555
| Lake County | TN | 6597 | 73.6 | 11.5 | 6.1 | 33.4 | 29281
| Lee County | KY | 7454 | 73.0 | 7.9 | 5.3 | 33.5 | 29143
| McCreary County | KY | 16681 | 77.9 | 7.0 | 5.5 | 33.5 | 32938
| Perry County | AL | 8317 | 78.6 | 18.9 | 7.9 | 33.7 | 31522
| Quitman County | MS | 5911 | 74.6 | 11.2 | 8.3 | 33.8 | 31877
| Lee County | AR | 8559 | 81.8 | 9.8 | 5.7 | 34.9 | 29714
| Knox County | KY | 30019 | 76.1 | 15.3 | 5.9 | 35.1 | 32646
| Sharkey County | MS | 3648 | 79.8 | 17.0 | 9.0 | 35.1 | 32650
| Sumter County | AL | 11961 | 87.3 | 19.5 | 4.4 | 35.1 | 29490
| Madison Parish | LA | 9804 | 75.4 | 15.1 | 6.9 | 35.3 | 33619
| Allendale Count | SC | 7870 | 76.3 | 10.4 | 7.6 | 35.4 | 31262
| Leflore County | MS | 27398 | 82.5 | 18.8 | 8.0 | 35.6 | 31091
| Owsley County | KY | 3967 | 68.5 | 11.5 | 6.7 | 35.6 | 29365
| Phillips County | AR | 15822 | 81.7 | 14.3 | 7.7 | 35.7 | 32419
| Buffalo County | SD | 1912 | 81.1 | 6.9 | 4.6 | 35.9 | 25653
| Clay County | KY | 20184 | 68.3 | 11.5 | 6.4 | 35.9 | 30700
| Holmes County | MS | 16476 | 77.6 | 12.7 | 10.6 | 37.8 | 28236
| Coahoma County | MS | 20732 | 81.2 | 18.4 | 8.4 | 37.9 | 31234
| Sunflower Count | MS | 25328 | 76.1 | 16.1 | 8.9 | 38.7 | 34017
| East Carroll Pa | LA | 7242 | 65.6 | 10.2 | 9.9 | 39.9 | 30288
| Martin County | KY | 11157 | 73.7 | 11.8 | 8.6 | 40.5 | 29387
| Corson County | SD | 3843 | 86.0 | 15.5 | 4.0 | 41.9 | 34372
| Issaquena Count | MS | 1297 | 59.5 | 4.5 | 8.9 | 43.9 | 29050
-------------------------------------------------------------------------
Please select one of the following choices:
1. Filter records by county name
2. Filter records by median income
3. Sort by population
4. Sort by poverty rate
5. Reset list to all records
0. Quit
Enter selection: 0
Goodbye!