Skip to content

prairie-guy/2019-State-and-County-Population-with-FIPS-key

Repository files navigation

2019-State-and-County-Population-with-FIPS-key

Julia Functions to Access State and County Populations based upon 2019 Cenus Data

I developed these while analyzing COVID-19 data. I wanted to be able to use the FIPS number (a US Census terms), a field in the New York Times (https://github.com/nytimes/covid-19-data) COVID-19 database, as a key to augment their data with State and County populations.

Accesor API to get Populations

Copy and Paste these self contained Julia functions into code (No Packages needed)

State Populations

using CSV
function get_state_populations()
    url = "https://raw.githubusercontent.com/prairie-guy/2019-State-and-County-Population-with-FIPS-key/master/2019_state_populations.csv"
    CSV.read(download(url),type=String,types=Dict(3=>Int64))
end
get_state_populations (generic function with 1 method)
get_state_populations()

51 rows × 3 columns

fipsstatepopulation
StringStringInt64
101000Alabama4903185
202000Alaska731545
304000Arizona7278717
405000Arkansas3017804
506000California39512223
608000Colorado5758736
709000Connecticut3565287
810000Delaware973764
911000District of Columbia705749
1012000Florida21477737
1113000Georgia10617423
1215000Hawaii1415872
1316000Idaho1787065
1417000Illinois12671821
1518000Indiana6732219
1619000Iowa3155070
1720000Kansas2913314
1821000Kentucky4467673
1922000Louisiana4648794
2023000Maine1344212
2124000Maryland6045680
2225000Massachusetts6892503
2326000Michigan9986857
2427000Minnesota5639632
2528000Mississippi2976149
2629000Missouri6137428
2730000Montana1068778
2831000Nebraska1934408
2932000Nevada3080156
3033000New Hampshire1359711

County Populations

using CSV
function get_county_populations()
    url = "https://raw.githubusercontent.com/prairie-guy/2019-State-and-County-Population-with-FIPS-key/master/2019_county_populations.csv"
    CSV.read(download(url),type=String,types=Dict(4=>Int64))
end
get_county_populations (generic function with 1 method)
get_county_populations()

3,142 rows × 4 columns

fipsstatecountypopulation
StringStringStringInt64
101001AlabamaAutauga County55869
201003AlabamaBaldwin County223234
301005AlabamaBarbour County24686
401007AlabamaBibb County22394
501009AlabamaBlount County57826
601011AlabamaBullock County10101
701013AlabamaButler County19448
801015AlabamaCalhoun County113605
901017AlabamaChambers County33254
1001019AlabamaCherokee County26196
1101021AlabamaChilton County44428
1201023AlabamaChoctaw County12589
1301025AlabamaClarke County23622
1401027AlabamaClay County13235
1501029AlabamaCleburne County14910
1601031AlabamaCoffee County52342
1701033AlabamaColbert County55241
1801035AlabamaConecuh County12067
1901037AlabamaCoosa County10663
2001039AlabamaCovington County37049
2101041AlabamaCrenshaw County13772
2201043AlabamaCullman County83768
2301045AlabamaDale County49172
2401047AlabamaDallas County37196
2501049AlabamaDeKalb County71513
2601051AlabamaElmore County81209
2701053AlabamaEscambia County36633
2801055AlabamaEtowah County102268
2901057AlabamaFayette County16302
3001059AlabamaFranklin County31362

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published