This example shows filtering by median income and then sorting by poverty rate.

$ 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: 2
  minimum median income? 95000
  maximum median income? 104500

=========================================================================
|          County | State |Total Pop| H.S. | Coll |Unemp |Pvrty | Income
-------------------------------------------------------------------------
| Alexandria city |    VA |  155203 | 93.1 | 65.2 |  3.8 |  9.9 | 100877
|    Boone County |    IN |   73006 | 94.4 | 49.4 |  2.3 |  5.5 |  98047
|    Bucks County |    PA |  647159 | 94.4 | 42.9 |  5.0 |  6.5 |  99755
|  Carroll County |    MD |  174208 | 93.8 | 38.0 |  3.9 |  5.4 | 102006
|  Charles County |    MD |  168870 | 93.6 | 31.1 |  5.3 |  6.7 | 103918
| Cherokee County |    GA |  274839 | 92.0 | 38.4 |  2.6 |  7.0 |  96997
|   Collin County |    TX | 1114450 | 93.9 | 53.4 |  4.4 |  6.6 | 102119
|   Denton County |    TX |  943857 | 93.2 | 47.3 |  4.4 |  7.4 |  98027
|   DuPage County |    IL |  926448 | 93.5 | 50.7 |  4.5 |  6.9 |  99536
| Fairfield Count |    CT |  957419 | 90.1 | 49.2 |  6.1 |  9.1 | 100703
| Fort Bend Count |    TX |  860124 | 91.0 | 48.1 |  5.9 |  7.2 |  98070
| Frederick Count |    MD |  280410 | 93.0 | 42.3 |  4.4 |  6.6 | 104253
| Goochland Count |    VA |   25499 | 94.0 | 46.1 |  3.1 |  6.3 | 104379
|  Hanover County |    VA |  111821 | 93.8 | 40.5 |  3.0 |  6.7 |  95195
|  Harford County |    MD |  263292 | 93.8 | 37.7 |  4.4 |  7.6 |  95951
|  Kendall County |    IL |  134948 | 93.6 | 35.3 |  4.7 |  4.9 | 100483
|  Kendall County |    TX |   46851 | 93.3 | 47.5 |  3.9 |  6.8 | 102832
| King George Cou |    VA |   27522 | 92.3 | 34.9 |  2.9 |  6.5 |  98668
|     Lake County |    IL |  712160 | 90.7 | 46.3 |  5.4 |  8.5 |  95895
|   Loving County |    TX |      57 | 94.2 |  0.0 |  1.0 |  5.3 | 100917
|   Manassas city |    VA |   42765 | 85.9 | 32.1 |  3.9 |  8.6 | 100530
| Middlesex Count |    NJ |  862328 | 89.8 | 44.8 |  6.0 |  8.0 |  98992
| Montgomery Coun |    PA |  864022 | 94.6 | 50.7 |  4.7 |  7.0 | 102648
| New Kent County |    VA |   23979 | 93.3 | 32.8 |  3.0 |  4.9 | 102920
| North Slope Bor |    AK |   11011 | 87.6 | 15.6 |  6.5 | 12.4 |  95041
|   Orange County |    CA | 3161005 | 86.6 | 42.1 |  6.0 |  9.9 | 100210
|   Pitkin County |    CO |   17350 | 97.4 | 62.3 |  5.9 |  6.7 |  96316
|   Placer County |    CA |  412789 | 94.8 | 41.6 |  5.1 |  6.6 | 103588
| Plymouth County |    MA |  532919 | 93.0 | 39.3 |  5.9 |  7.5 |  99445
| Powhatan County |    VA |   31172 | 91.4 | 31.1 |  2.9 |  6.0 |  99854
| Rockingham Coun |    NH |  318214 | 95.5 | 42.8 |  3.4 |  4.6 | 104281
| Rockland County |    NY |  339256 | 88.9 | 42.0 |  4.4 | 15.2 |  98054
| San Benito Coun |    CA |   66675 | 83.2 | 20.5 |  7.3 |  8.9 |  95187
| Snohomish Count |    WA |  836037 | 92.9 | 34.1 |  4.8 |  7.2 |  99650
| Spotsylvania Co |    VA |  143957 | 91.6 | 33.5 |  3.8 |  7.2 | 100162
|   Sussex County |    NJ |  145645 | 95.3 | 38.1 |  6.2 |  6.1 |  99695
|    Teton County |    WY |   23622 | 96.1 | 57.9 |  3.3 |  5.9 | 102709
|    Union County |    OH |   65110 | 94.3 | 37.8 |  3.6 |  5.5 |  98167
|  Ventura County |    CA |  839358 | 85.6 | 34.0 |  6.2 |  8.9 |  95819
|   Warren County |    OH |  246822 | 94.5 | 44.1 |  4.0 |  5.9 |  97011
|  Wasatch County |    UT |   36260 | 96.0 | 44.2 |  2.9 |  4.9 | 102206
| Washington Coun |    NE |   20993 | 95.6 | 33.7 |  2.5 |  6.3 | 100572
| Williamson Coun |    TX |  644451 | 94.0 | 44.8 |  4.0 |  6.0 |  96653
|   Wright County |    MN |  145143 | 94.6 | 31.9 |  3.5 |  4.9 |  99744
|     York County |    VA |   71176 | 95.2 | 48.5 |  3.3 |  5.1 |  97500
-------------------------------------------------------------------------

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
-------------------------------------------------------------------------
| Rockingham Coun |    NH |  318214 | 95.5 | 42.8 |  3.4 |  4.6 | 104281
|  Kendall County |    IL |  134948 | 93.6 | 35.3 |  4.7 |  4.9 | 100483
| New Kent County |    VA |   23979 | 93.3 | 32.8 |  3.0 |  4.9 | 102920
|  Wasatch County |    UT |   36260 | 96.0 | 44.2 |  2.9 |  4.9 | 102206
|   Wright County |    MN |  145143 | 94.6 | 31.9 |  3.5 |  4.9 |  99744
|     York County |    VA |   71176 | 95.2 | 48.5 |  3.3 |  5.1 |  97500
|   Loving County |    TX |      57 | 94.2 |  0.0 |  1.0 |  5.3 | 100917
|  Carroll County |    MD |  174208 | 93.8 | 38.0 |  3.9 |  5.4 | 102006
|    Boone County |    IN |   73006 | 94.4 | 49.4 |  2.3 |  5.5 |  98047
|    Union County |    OH |   65110 | 94.3 | 37.8 |  3.6 |  5.5 |  98167
|    Teton County |    WY |   23622 | 96.1 | 57.9 |  3.3 |  5.9 | 102709
|   Warren County |    OH |  246822 | 94.5 | 44.1 |  4.0 |  5.9 |  97011
| Powhatan County |    VA |   31172 | 91.4 | 31.1 |  2.9 |  6.0 |  99854
| Williamson Coun |    TX |  644451 | 94.0 | 44.8 |  4.0 |  6.0 |  96653
|   Sussex County |    NJ |  145645 | 95.3 | 38.1 |  6.2 |  6.1 |  99695
| Goochland Count |    VA |   25499 | 94.0 | 46.1 |  3.1 |  6.3 | 104379
| Washington Coun |    NE |   20993 | 95.6 | 33.7 |  2.5 |  6.3 | 100572
|    Bucks County |    PA |  647159 | 94.4 | 42.9 |  5.0 |  6.5 |  99755
| King George Cou |    VA |   27522 | 92.3 | 34.9 |  2.9 |  6.5 |  98668
|   Collin County |    TX | 1114450 | 93.9 | 53.4 |  4.4 |  6.6 | 102119
| Frederick Count |    MD |  280410 | 93.0 | 42.3 |  4.4 |  6.6 | 104253
|   Placer County |    CA |  412789 | 94.8 | 41.6 |  5.1 |  6.6 | 103588
|  Charles County |    MD |  168870 | 93.6 | 31.1 |  5.3 |  6.7 | 103918
|  Hanover County |    VA |  111821 | 93.8 | 40.5 |  3.0 |  6.7 |  95195
|   Pitkin County |    CO |   17350 | 97.4 | 62.3 |  5.9 |  6.7 |  96316
|  Kendall County |    TX |   46851 | 93.3 | 47.5 |  3.9 |  6.8 | 102832
|   DuPage County |    IL |  926448 | 93.5 | 50.7 |  4.5 |  6.9 |  99536
| Cherokee County |    GA |  274839 | 92.0 | 38.4 |  2.6 |  7.0 |  96997
| Montgomery Coun |    PA |  864022 | 94.6 | 50.7 |  4.7 |  7.0 | 102648
| Fort Bend Count |    TX |  860124 | 91.0 | 48.1 |  5.9 |  7.2 |  98070
| Snohomish Count |    WA |  836037 | 92.9 | 34.1 |  4.8 |  7.2 |  99650
| Spotsylvania Co |    VA |  143957 | 91.6 | 33.5 |  3.8 |  7.2 | 100162
|   Denton County |    TX |  943857 | 93.2 | 47.3 |  4.4 |  7.4 |  98027
| Plymouth County |    MA |  532919 | 93.0 | 39.3 |  5.9 |  7.5 |  99445
|  Harford County |    MD |  263292 | 93.8 | 37.7 |  4.4 |  7.6 |  95951
| Middlesex Count |    NJ |  862328 | 89.8 | 44.8 |  6.0 |  8.0 |  98992
|     Lake County |    IL |  712160 | 90.7 | 46.3 |  5.4 |  8.5 |  95895
|   Manassas city |    VA |   42765 | 85.9 | 32.1 |  3.9 |  8.6 | 100530
| San Benito Coun |    CA |   66675 | 83.2 | 20.5 |  7.3 |  8.9 |  95187
|  Ventura County |    CA |  839358 | 85.6 | 34.0 |  6.2 |  8.9 |  95819
| Fairfield Count |    CT |  957419 | 90.1 | 49.2 |  6.1 |  9.1 | 100703
| Alexandria city |    VA |  155203 | 93.1 | 65.2 |  3.8 |  9.9 | 100877
|   Orange County |    CA | 3161005 | 86.6 | 42.1 |  6.0 |  9.9 | 100210
| North Slope Bor |    AK |   11011 | 87.6 | 15.6 |  6.5 | 12.4 |  95041
| Rockland County |    NY |  339256 | 88.9 | 42.0 |  4.4 | 15.2 |  98054
-------------------------------------------------------------------------

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!