11. Data Storytelling#
Explore the data below (ie features, stats, and visualizations).
Develop 2-3 questions/theses that might be addressed by these data.
Clean and combine data sources.
Choose a model. What aspects of the model will help support your thesis or answer your question?
Assess and interpret your model.
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
elec_df = pd.read_csv('https://raw.githubusercontent.com/GettysburgDataScience/datasets/refs/heads/main/us_political/countypres_2000-2024.csv')
health_df = pd.read_csv('https://raw.githubusercontent.com/GettysburgDataScience/datasets/refs/heads/main/us_political/countyHealth_2025.csv', skiprows = [1])
agesex_df = pd.read_csv('https://raw.githubusercontent.com/GettysburgDataScience/datasets/refs/heads/main/us_political/stats_america/Population-by-Age-and-Sex/Population%20by%20Age%20and%20Sex%20-%20US%2C%20States%2C%20Counties.csv')
race_df = pd.read_csv('https://raw.githubusercontent.com/GettysburgDataScience/datasets/refs/heads/main/us_political/stats_america/Population-by-Race/Population%20by%20Race%20-%20US%2C%20States%2C%20Counties.csv')
social_df = pd.read_csv('https://raw.githubusercontent.com/GettysburgDataScience/datasets/refs/heads/main/us_political/stats_america/Social-Context/Social%20Context.csv')
dev_df = pd.read_csv('https://raw.githubusercontent.com/GettysburgDataScience/datasets/refs/heads/main/us_political/stats_america/Metrics-For-Development/Metrics%20For%20Development.csv')
11.1. Election Data#
elec_df.head()
| year | state | state_po | county_name | county_fips | office | candidate | party | candidatevotes | totalvotes | version | mode | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 2000 | ALABAMA | AL | AUTAUGA | 1001.0 | US PRESIDENT | AL GORE | DEMOCRAT | 4942 | 17208 | 20250821 | TOTAL |
| 1 | 2000 | ALABAMA | AL | AUTAUGA | 1001.0 | US PRESIDENT | GEORGE W. BUSH | REPUBLICAN | 11993 | 17208 | 20250821 | TOTAL |
| 2 | 2000 | ALABAMA | AL | AUTAUGA | 1001.0 | US PRESIDENT | OTHER | OTHER | 113 | 17208 | 20250821 | TOTAL |
| 3 | 2000 | ALABAMA | AL | AUTAUGA | 1001.0 | US PRESIDENT | RALPH NADER | GREEN | 160 | 17208 | 20250821 | TOTAL |
| 4 | 2000 | ALABAMA | AL | BALDWIN | 1003.0 | US PRESIDENT | AL GORE | DEMOCRAT | 13997 | 56480 | 20250821 | TOTAL |
columns_to_keep = ['year', 'county_fips', 'candidate', 'candidatevotes', 'totalvotes']
elec_R_df = elec_df.query('party == "REPUBLICAN" and mode.str.startswith("TOTAL")')[columns_to_keep]
elec_D_df = elec_df.query('party == "DEMOCRAT" and mode.str.startswith("TOTAL")')[columns_to_keep]
elections_df = pd.merge(left = elec_D_df, right = elec_R_df,
how = 'inner', on = ['year', 'county_fips'], suffixes = ['_D', '_R'])
elections_df.drop(columns = 'totalvotes_D', inplace = True)
elections_df.rename(columns = {'totalvotes_R':'totalvotes'})
elections_df.head()
| year | county_fips | candidate_D | candidatevotes_D | candidate_R | candidatevotes_R | totalvotes_R | |
|---|---|---|---|---|---|---|---|
| 0 | 2000 | 1001.0 | AL GORE | 4942 | GEORGE W. BUSH | 11993 | 17208 |
| 1 | 2000 | 1003.0 | AL GORE | 13997 | GEORGE W. BUSH | 40872 | 56480 |
| 2 | 2000 | 1005.0 | AL GORE | 5188 | GEORGE W. BUSH | 5096 | 10395 |
| 3 | 2000 | 1007.0 | AL GORE | 2710 | GEORGE W. BUSH | 4273 | 7101 |
| 4 | 2000 | 1009.0 | AL GORE | 4977 | GEORGE W. BUSH | 12667 | 17973 |
fips_df = elec_df[['state_po', 'county_name', 'county_fips']].drop_duplicates().reset_index(drop = True)
fips_df.head()
| state_po | county_name | county_fips | |
|---|---|---|---|
| 0 | AL | AUTAUGA | 1001.0 |
| 1 | AL | BALDWIN | 1003.0 |
| 2 | AL | BARBOUR | 1005.0 |
| 3 | AL | BIBB | 1007.0 |
| 4 | AL | BLOUNT | 1009.0 |
## County Health Data
health_df.head(3)
| State FIPS Code | County FIPS Code | 5-digit FIPS Code | State Abbreviation | Name | Release Year | County Clustered (Yes=1/No=0) | Premature Death raw value | Premature Death numerator | Premature Death denominator | ... | % Rural raw value | % Rural numerator | % Rural denominator | % Rural CI low | % Rural CI high | Population raw value | Population numerator | Population denominator | Population CI low | Population CI high | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | US | United States | 2025 | NaN | 8351.736549 | 4763989.0 | 925367214.0 | ... | 0.200031 | 66300254.0 | 331449281.0 | NaN | NaN | 334914895.0 | NaN | NaN | NaN | NaN |
| 1 | 1 | 0 | 1000 | AL | Alabama | 2025 | NaN | 11853.247248 | 102760.0 | 13958454.0 | ... | 0.422628 | 2123399.0 | 5024279.0 | NaN | NaN | 5108468.0 | NaN | NaN | NaN | NaN |
| 2 | 1 | 1 | 1001 | AL | Autauga County | 2025 | 1.0 | 9938.263382 | 1008.0 | 163064.0 | ... | 0.406768 | 23920.0 | 58805.0 | NaN | NaN | 60342.0 | NaN | NaN | NaN | NaN |
3 rows × 796 columns
def print_cols(df, num_cols = 2):
col_str = ''
for k, col in enumerate(df.columns):
col_str += f'{k:>3}. {col:<40}'
if k % num_cols == 0:
col_str += '\n'
print(col_str)
print_cols(health_df, num_cols = 4)
0. State FIPS Code
1. County FIPS Code 2. 5-digit FIPS Code 3. State Abbreviation 4. Name
5. Release Year 6. County Clustered (Yes=1/No=0) 7. Premature Death raw value 8. Premature Death numerator
9. Premature Death denominator 10. Premature Death CI low 11. Premature Death CI high 12. Premature Death flag (0 = No Flag/1=Unreliable/2=Suppressed)
13. Premature Death (AIAN) 14. Premature Death CI low (AIAN) 15. Premature Death CI high (AIAN) 16. Premature Death flag (AIAN) (. = No Flag/1=Unreliable/2=Suppressed)
17. Premature Death (Asian) 18. Premature Death CI low (Asian) 19. Premature Death CI high (Asian) 20. Premature Death flag (Asian) (. = No Flag/1=Unreliable/2=Suppressed)
21. Premature Death (Black) 22. Premature Death CI low (Black) 23. Premature Death CI high (Black) 24. Premature Death flag (Black) (. = No Flag/1=Unreliable/2=Suppressed)
25. Premature Death (Hispanic) 26. Premature Death CI low (Hispanic) 27. Premature Death CI high (Hispanic) 28. Premature Death flag (Hispanic) (. = No Flag/1=Unreliable/2=Suppressed)
29. Premature Death (White) 30. Premature Death CI low (White) 31. Premature Death CI high (White) 32. Premature Death flag (White) (. = No Flag/1=Unreliable/2=Suppressed)
33. Premature Death (NHOPI) 34. Premature Death CI low (NHOPI) 35. Premature Death CI high (NHOPI) 36. Premature Death flag (NHOPI) (. = No Flag/1=Unreliable/2=Suppressed)
37. Premature Death flag (Two or more races) (. = No Flag/1=Unreliable/2=Suppressed) 38. Poor Physical Health Days raw value 39. Poor Physical Health Days numerator 40. Poor Physical Health Days denominator
41. Poor Physical Health Days CI low 42. Poor Physical Health Days CI high 43. Low Birth Weight raw value 44. Low Birth Weight numerator
45. Low Birth Weight denominator 46. Low Birth Weight CI low 47. Low Birth Weight CI high 48. LBW unreliable indicator (Unreliable = Numerator < 20 or relative standard error > 20%)
49. Low Birth Weight (AIAN) 50. Low Birth Weight CI low (AIAN) 51. Low Birth Weight CI high (AIAN) 52. Low Birth Weight (Asian)
53. Low Birth Weight CI low (Asian) 54. Low Birth Weight CI high (Asian) 55. Low Birth Weight (Black) 56. Low Birth Weight CI low (Black)
57. Low Birth Weight CI high (Black) 58. Low Birth Weight (Hispanic) 59. Low Birth Weight CI low (Hispanic) 60. Low Birth Weight CI high (Hispanic)
61. Low Birth Weight (White) 62. Low Birth Weight CI low (White) 63. Low Birth Weight CI high (White) 64. Low Birth Weight (NHOPI)
65. Low Birth Weight CI low (NHOPI) 66. Low Birth Weight CI high (NHOPI) 67. Low Birth Weight (Two or more races) 68. Low Birth Weight CI low (Two or more races)
69. Low Birth Weight CI high (Two or more races) 70. Poor Mental Health Days raw value 71. Poor Mental Health Days numerator 72. Poor Mental Health Days denominator
73. Poor Mental Health Days CI low 74. Poor Mental Health Days CI high 75. Poor or Fair Health raw value 76. Poor or Fair Health numerator
77. Poor or Fair Health denominator 78. Poor or Fair Health CI low 79. Poor or Fair Health CI high 80. Flu Vaccinations raw value
81. Flu Vaccinations numerator 82. Flu Vaccinations denominator 83. Flu Vaccinations CI low 84. Flu Vaccinations CI high
85. Flu Vaccinations (AIAN) 86. Flu Vaccinations (Asian/Pacific Islander) 87. Flu Vaccinations (Black) 88. Flu Vaccinations (Hispanic)
89. Flu Vaccinations (White) 90. Access to Exercise Opportunities raw value 91. Access to Exercise Opportunities numerator 92. Access to Exercise Opportunities denominator
93. Access to Exercise Opportunities CI low 94. Access to Exercise Opportunities CI high 95. Food Environment Index raw value 96. Food Environment Index numerator
97. Food Environment Index denominator 98. Food Environment Index CI low 99. Food Environment Index CI high 100. Primary Care Physicians raw value
101. Primary Care Physicians numerator 102. Primary Care Physicians denominator 103. Primary Care Physicians CI low 104. Primary Care Physicians CI high
105. Ratio of population to primary care physicians.106. Mental Health Providers raw value 107. Mental Health Providers numerator 108. Mental Health Providers denominator
109. Mental Health Providers CI low 110. Mental Health Providers CI high 111. Ratio of population to mental health providers.112. Dentists raw value
113. Dentists numerator 114. Dentists denominator 115. Dentists CI low 116. Dentists CI high
117. Ratio of population to dentists. 118. Preventable Hospital Stays raw value 119. Preventable Hospital Stays numerator 120. Preventable Hospital Stays denominator
121. Preventable Hospital Stays CI low 122. Preventable Hospital Stays CI high 123. Preventable Hospital Stays (AIAN) 124. Preventable Hospital Stays (Asian/Pacific Islander)
125. Preventable Hospital Stays (Black) 126. Preventable Hospital Stays (Hispanic) 127. Preventable Hospital Stays (White) 128. Mammography Screening raw value
129. Mammography Screening numerator 130. Mammography Screening denominator 131. Mammography Screening CI low 132. Mammography Screening CI high
133. Mammography Screening (AIAN) 134. Mammography Screening (Asian/Pacific Islander)135. Mammography Screening (Black) 136. Mammography Screening (Hispanic)
137. Mammography Screening (White) 138. Uninsured raw value 139. Uninsured numerator 140. Uninsured denominator
141. Uninsured CI low 142. Uninsured CI high 143. Severe Housing Problems raw value 144. Severe Housing Problems numerator
145. Severe Housing Problems denominator 146. Severe Housing Problems CI low 147. Severe Housing Problems CI high 148. Percentage of households with high housing costs
149. Percentage of households with high housing costs CI low150. Percentage of households with high housing costs CI high151. Percentage of households with overcrowding152. Percentage of households with overcrowding CI low
153. Percentage of households with overcrowding CI high154. Percentage of households with lack of kitchen or plumbing facilities155. Percentage of households with lack of kitchen or plumbing facilities CI low156. Percentage of households with lack of kitchen or plumbing facilities CI high
157. Driving Alone to Work raw value 158. Driving Alone to Work numerator 159. Driving Alone to Work denominator 160. Driving Alone to Work CI low
161. Driving Alone to Work CI high 162. Driving Alone to Work (AIAN) 163. Driving Alone to Work CI low (AIAN) 164. Driving Alone to Work CI high (AIAN)
165. Driving Alone to Work (Asian/Pacific Islander)166. Driving Alone to Work CI low (Asian/Pacific Islander)167. Driving Alone to Work CI high (Asian/Pacific Islander)168. Driving Alone to Work (Black)
169. Driving Alone to Work CI low (Black) 170. Driving Alone to Work CI high (Black) 171. Driving Alone to Work (Hispanic) 172. Driving Alone to Work CI low (Hispanic)
173. Driving Alone to Work CI high (Hispanic)174. Driving Alone to Work (White) 175. Driving Alone to Work CI low (White) 176. Driving Alone to Work CI high (White)
177. Long Commute - Driving Alone raw value 178. Long Commute - Driving Alone numerator 179. Long Commute - Driving Alone denominator180. Long Commute - Driving Alone CI low
181. Long Commute - Driving Alone CI high 182. Air Pollution: Particulate Matter raw value183. Air Pollution: Particulate Matter numerator184. Air Pollution: Particulate Matter denominator
185. Air Pollution: Particulate Matter CI low186. Air Pollution: Particulate Matter CI high187. Drinking Water Violations raw value 188. Drinking Water Violations numerator
189. Drinking Water Violations denominator 190. Drinking Water Violations CI low 191. Drinking Water Violations CI high 192. Broadband Access raw value
193. Broadband Access numerator 194. Broadband Access denominator 195. Broadband Access CI low 196. Broadband Access CI high
197. Library Access raw value 198. Library Access numerator 199. Library Access denominator 200. Library Access CI low
201. Library Access CI high 202. Some College raw value 203. Some College numerator 204. Some College denominator
205. Some College CI low 206. Some College CI high 207. High School Completion raw value 208. High School Completion numerator
209. High School Completion denominator 210. High School Completion CI low 211. High School Completion CI high 212. Unemployment raw value
213. Unemployment numerator 214. Unemployment denominator 215. Unemployment CI low 216. Unemployment CI high
217. Income Inequality raw value 218. Income Inequality numerator 219. Income Inequality denominator 220. Income Inequality CI low
221. Income Inequality CI high 222. Children in Poverty raw value 223. Children in Poverty numerator 224. Children in Poverty denominator
225. Children in Poverty CI low 226. Children in Poverty CI high 227. Children in Poverty (AIAN) 228. Children in Poverty CI low (AIAN)
229. Children in Poverty CI high (AIAN) 230. Children in Poverty (Asian/Pacific Islander)231. Children in Poverty CI low (Asian/Pacific Islander)232. Children in Poverty CI high (Asian/Pacific Islander)
233. Children in Poverty (Black) 234. Children in Poverty CI low (Black) 235. Children in Poverty CI high (Black) 236. Children in Poverty (Hispanic)
237. Children in Poverty CI low (Hispanic) 238. Children in Poverty CI high (Hispanic) 239. Children in Poverty (White) 240. Children in Poverty CI low (White)
241. Children in Poverty CI high (White) 242. Injury Deaths raw value 243. Injury Deaths numerator 244. Injury Deaths denominator
245. Injury Deaths CI low 246. Injury Deaths CI high 247. Injury Deaths (AIAN) 248. Injury Deaths CI low (AIAN)
249. Injury Deaths CI high (AIAN) 250. Injury Deaths (Asian) 251. Injury Deaths CI low (Asian) 252. Injury Deaths CI high (Asian)
253. Injury Deaths (Black) 254. Injury Deaths CI low (Black) 255. Injury Deaths CI high (Black) 256. Injury Deaths (Hispanic)
257. Injury Deaths CI low (Hispanic) 258. Injury Deaths CI high (Hispanic) 259. Injury Deaths (White) 260. Injury Deaths CI low (White)
261. Injury Deaths CI high (White) 262. Injury Deaths (NHOPI) 263. Injury Deaths CI low (NHOPI) 264. Injury Deaths CI high (NHOPI)
265. Social Associations raw value 266. Social Associations numerator 267. Social Associations denominator 268. Social Associations CI low
269. Social Associations CI high 270. Child Care Cost Burden raw value 271. Child Care Cost Burden numerator 272. Child Care Cost Burden denominator
273. Child Care Cost Burden CI low 274. Child Care Cost Burden CI high 275. Life Expectancy raw value 276. Life Expectancy numerator
277. Life Expectancy denominator 278. Life Expectancy CI low 279. Life Expectancy CI high 280. Life Expectancy (AIAN)
281. Life Expectancy CI low (AIAN) 282. Life Expectancy CI high (AIAN) 283. Life Expectancy (Asian) 284. Life Expectancy CI low (Asian)
285. Life Expectancy CI high (Asian) 286. Life Expectancy (Black) 287. Life Expectancy CI low (Black) 288. Life Expectancy CI high (Black)
289. Life Expectancy (Hispanic) 290. Life Expectancy CI low (Hispanic) 291. Life Expectancy CI high (Hispanic) 292. Life Expectancy (White)
293. Life Expectancy CI low (White) 294. Life Expectancy CI high (White) 295. Life Expectancy (NHOPI) 296. Life Expectancy CI low (NHOPI)
297. Life Expectancy CI high (NHOPI) 298. Premature Age-Adjusted Mortality raw value299. Premature Age-Adjusted Mortality numerator300. Premature Age-Adjusted Mortality denominator
301. Premature Age-Adjusted Mortality CI low 302. Premature Age-Adjusted Mortality CI high303. Premature Age-Adjusted Mortality (AIAN) 304. Premature Age-Adjusted Mortality CI low (AIAN)
305. Premature Age-Adjusted Mortality CI high (AIAN)306. Premature Age-Adjusted Mortality (Asian)307. Premature Age-Adjusted Mortality CI low (Asian)308. Premature Age-Adjusted Mortality CI high (Asian)
309. Premature Age-Adjusted Mortality (Black)310. Premature Age-Adjusted Mortality CI low (Black)311. Premature Age-Adjusted Mortality CI high (Black)312. Premature Age-Adjusted Mortality (Hispanic)
313. Premature Age-Adjusted Mortality CI low (Hispanic)314. Premature Age-Adjusted Mortality CI high (Hispanic)315. Premature Age-Adjusted Mortality (White)316. Premature Age-Adjusted Mortality CI low (White)
317. Premature Age-Adjusted Mortality CI high (White)318. Premature Age-Adjusted Mortality (NHOPI)319. Premature Age-Adjusted Mortality CI low (NHOPI)320. Premature Age-Adjusted Mortality CI high (NHOPI)
321. Child Mortality raw value 322. Child Mortality numerator 323. Child Mortality denominator 324. Child Mortality CI low
325. Child Mortality CI high 326. Child Mortality (AIAN) 327. Child Mortality CI low (AIAN) 328. Child Mortality CI high (AIAN)
329. Child Mortality (Asian) 330. Child Mortality CI low (Asian) 331. Child Mortality CI high (Asian) 332. Child Mortality (Black)
333. Child Mortality CI low (Black) 334. Child Mortality CI high (Black) 335. Child Mortality (Hispanic) 336. Child Mortality CI low (Hispanic)
337. Child Mortality CI high (Hispanic) 338. Child Mortality (White) 339. Child Mortality CI low (White) 340. Child Mortality CI high (White)
341. Child Mortality (NHOPI) 342. Child Mortality CI low (NHOPI) 343. Child Mortality CI high (NHOPI) 344. Infant Mortality raw value
345. Infant Mortality numerator 346. Infant Mortality denominator 347. Infant Mortality CI low 348. Infant Mortality CI high
349. Infant Mortality (AIAN) 350. Infant Mortality CI low (AIAN) 351. Infant Mortality CI high (AIAN) 352. Infant Mortality (Asian)
353. Infant Mortality CI low (Asian) 354. Infant Mortality CI high (Asian) 355. Infant Mortality (Black) 356. Infant Mortality CI low (Black)
357. Infant Mortality CI high (Black) 358. Infant Mortality (Hispanic) 359. Infant Mortality CI low (Hispanic) 360. Infant Mortality CI high (Hispanic)
361. Infant Mortality (White) 362. Infant Mortality CI low (White) 363. Infant Mortality CI high (White) 364. Infant Mortality (NHOPI)
365. Infant Mortality CI low (NHOPI) 366. Infant Mortality CI high (NHOPI) 367. Infant Mortality (Two or more races) 368. Infant Mortality CI low (Two or more races)
369. Infant Mortality CI high (Two or more races)370. Frequent Physical Distress raw value 371. Frequent Physical Distress numerator 372. Frequent Physical Distress denominator
373. Frequent Physical Distress CI low 374. Frequent Physical Distress CI high 375. Diabetes Prevalence raw value 376. Diabetes Prevalence numerator
377. Diabetes Prevalence denominator 378. Diabetes Prevalence CI low 379. Diabetes Prevalence CI high 380. HIV Prevalence raw value
381. HIV Prevalence numerator 382. HIV Prevalence denominator 383. HIV Prevalence CI low 384. HIV Prevalence CI high
385. Adult Obesity raw value 386. Adult Obesity numerator 387. Adult Obesity denominator 388. Adult Obesity CI low
389. Adult Obesity CI high 390. Frequent Mental Distress raw value 391. Frequent Mental Distress numerator 392. Frequent Mental Distress denominator
393. Frequent Mental Distress CI low 394. Frequent Mental Distress CI high 395. Suicides raw value 396. Suicides numerator
397. Suicides denominator 398. Suicides CI low 399. Suicides CI high 400. Crude suicide rate
401. Suicides (AIAN) 402. Suicides CI low (AIAN) 403. Suicides CI high (AIAN) 404. Suicides (Asian)
405. Suicides CI low (Asian) 406. Suicides CI high (Asian) 407. Suicides (Black) 408. Suicides CI low (Black)
409. Suicides CI high (Black) 410. Suicides (Hispanic) 411. Suicides CI low (Hispanic) 412. Suicides CI high (Hispanic)
413. Suicides (White) 414. Suicides CI low (White) 415. Suicides CI high (White) 416. Suicides (NHOPI)
417. Suicides CI low (NHOPI) 418. Suicides CI high (NHOPI) 419. Feelings of Loneliness raw value 420. Feelings of Loneliness numerator
421. Feelings of Loneliness denominator 422. Feelings of Loneliness CI low 423. Feelings of Loneliness CI high 424. Limited Access to Healthy Foods raw value
425. Limited Access to Healthy Foods numerator426. Limited Access to Healthy Foods denominator427. Limited Access to Healthy Foods CI low 428. Limited Access to Healthy Foods CI high
429. Food Insecurity raw value 430. Food Insecurity numerator 431. Food Insecurity denominator 432. Food Insecurity CI low
433. Food Insecurity CI high 434. Insufficient Sleep raw value 435. Insufficient Sleep numerator 436. Insufficient Sleep denominator
437. Insufficient Sleep CI low 438. Insufficient Sleep CI high 439. Teen Births raw value 440. Teen Births numerator
441. Teen Births denominator 442. Teen Births CI low 443. Teen Births CI high 444. Teen Births (AIAN)
445. Teen Births CI low (AIAN) 446. Teen Births CI high (AIAN) 447. Teen Births (Asian) 448. Teen Births CI low (Asian)
449. Teen Births CI high (Asian) 450. Teen Births (Black) 451. Teen Births CI low (Black) 452. Teen Births CI high (Black)
453. Teen Births (Hispanic) 454. Teen Births CI low (Hispanic) 455. Teen Births CI high (Hispanic) 456. Teen Births (White)
457. Teen Births CI low (White) 458. Teen Births CI high (White) 459. Teen Births (NHOPI) 460. Teen Births CI low (NHOPI)
461. Teen Births CI high (NHOPI) 462. Teen Births (Two or more races) 463. Teen Births CI low (Two or more races) 464. Teen Births CI high (Two or more races)
465. Sexually Transmitted Infections raw value466. Sexually Transmitted Infections numerator467. Sexually Transmitted Infections denominator468. Sexually Transmitted Infections CI low
469. Sexually Transmitted Infections CI high 470. Excessive Drinking raw value 471. Excessive Drinking numerator 472. Excessive Drinking denominator
473. Excessive Drinking CI low 474. Excessive Drinking CI high 475. Alcohol-Impaired Driving Deaths raw value476. Alcohol-Impaired Driving Deaths numerator
477. Alcohol-Impaired Driving Deaths denominator478. Alcohol-Impaired Driving Deaths CI low 479. Alcohol-Impaired Driving Deaths CI high 480. Drug Overdose Deaths raw value
481. Drug Overdose Deaths numerator 482. Drug Overdose Deaths denominator 483. Drug Overdose Deaths CI low 484. Drug Overdose Deaths CI high
485. Drug Overdose Deaths (AIAN) 486. Drug Overdose Deaths CI low (AIAN) 487. Drug Overdose Deaths CI high (AIAN) 488. Drug Overdose Deaths (Asian)
489. Drug Overdose Deaths CI low (Asian) 490. Drug Overdose Deaths CI high (Asian) 491. Drug Overdose Deaths (Black) 492. Drug Overdose Deaths CI low (Black)
493. Drug Overdose Deaths CI high (Black) 494. Drug Overdose Deaths (Hispanic) 495. Drug Overdose Deaths CI low (Hispanic) 496. Drug Overdose Deaths CI high (Hispanic)
497. Drug Overdose Deaths (White) 498. Drug Overdose Deaths CI low (White) 499. Drug Overdose Deaths CI high (White) 500. Drug Overdose Deaths (NHOPI)
501. Drug Overdose Deaths CI low (NHOPI) 502. Drug Overdose Deaths CI high (NHOPI) 503. Adult Smoking raw value 504. Adult Smoking numerator
505. Adult Smoking denominator 506. Adult Smoking CI low 507. Adult Smoking CI high 508. Physical Inactivity raw value
509. Physical Inactivity numerator 510. Physical Inactivity denominator 511. Physical Inactivity CI low 512. Physical Inactivity CI high
513. Uninsured Adults raw value 514. Uninsured Adults numerator 515. Uninsured Adults denominator 516. Uninsured Adults CI low
517. Uninsured Adults CI high 518. Uninsured Children raw value 519. Uninsured Children numerator 520. Uninsured Children denominator
521. Uninsured Children CI low 522. Uninsured Children CI high 523. Other Primary Care Providers raw value 524. Other Primary Care Providers numerator
525. Other Primary Care Providers denominator526. Other Primary Care Providers CI low 527. Other Primary Care Providers CI high 528. Ratio of population to primary care providers other than physicians.
529. Traffic Volume raw value 530. Traffic Volume numerator 531. Traffic Volume denominator 532. Traffic Volume CI low
533. Traffic Volume CI high 534. Homeownership raw value 535. Homeownership numerator 536. Homeownership denominator
537. Homeownership CI low 538. Homeownership CI high 539. Severe Housing Cost Burden raw value 540. Severe Housing Cost Burden numerator
541. Severe Housing Cost Burden denominator 542. Severe Housing Cost Burden CI low 543. Severe Housing Cost Burden CI high 544. Access to Parks raw value
545. Access to Parks numerator 546. Access to Parks denominator 547. Access to Parks CI low 548. Access to Parks CI high
549. Adverse Climate Events raw value 550. Adverse Climate Events numerator 551. Adverse Climate Events denominator 552. Adverse Climate Events CI low
553. Adverse Climate Events CI high 554. Adverse Climate Events (Drought) 555. Adverse Climate Events (Heat) 556. Adverse Climate Events (Disasters)
557. Census Participation raw value 558. Census Participation numerator 559. Census Participation denominator 560. Census Participation CI low
561. Census Participation CI high 562. Voter Turnout raw value 563. Voter Turnout numerator 564. Voter Turnout denominator
565. Voter Turnout CI low 566. Voter Turnout CI high 567. High School Graduation raw value 568. High School Graduation numerator
569. High School Graduation denominator 570. High School Graduation CI low 571. High School Graduation CI high 572. Reading Scores raw value
573. Reading Scores numerator 574. Reading Scores denominator 575. Reading Scores CI low 576. Reading Scores CI high
577. Reading Scores (AIAN) 578. Reading Scores (Asian/Pacific Islander) 579. Reading Scores (Black) 580. Reading Scores (Hispanic)
581. Reading Scores (White) 582. Math Scores raw value 583. Math Scores numerator 584. Math Scores denominator
585. Math Scores CI low 586. Math Scores CI high 587. Math Scores (AIAN) 588. Math Scores (Asian/Pacific Islander)
589. Math Scores (Black) 590. Math Scores (Hispanic) 591. Math Scores (White) 592. School Segregation raw value
593. School Segregation numerator 594. School Segregation denominator 595. School Segregation CI low 596. School Segregation CI high
597. School Funding Adequacy raw value 598. School Funding Adequacy numerator 599. School Funding Adequacy denominator 600. School Funding Adequacy CI low
601. School Funding Adequacy CI high 602. Children Eligible for Free or Reduced Price Lunch raw value603. Children Eligible for Free or Reduced Price Lunch numerator604. Children Eligible for Free or Reduced Price Lunch denominator
605. Children Eligible for Free or Reduced Price Lunch CI low606. Children Eligible for Free or Reduced Price Lunch CI high607. Gender Pay Gap raw value 608. Gender Pay Gap numerator
609. Gender Pay Gap denominator 610. Gender Pay Gap CI low 611. Gender Pay Gap CI high 612. Median Household Income raw value
613. Median Household Income numerator 614. Median Household Income denominator 615. Median Household Income CI low 616. Median Household Income CI high
617. Median Household Income (AIAN) 618. Median Household Income CI low (AIAN) 619. Median Household Income CI high (AIAN) 620. Median household income (Asian)
621. Median household income CI low (Asian) 622. Median household income CI high (Asian) 623. Median Household Income (Black) 624. Median Household Income CI low (Black)
625. Median Household Income CI high (Black) 626. Median Household Income (Hispanic) 627. Median Household Income CI low (Hispanic)628. Median Household Income CI high (Hispanic)
629. Median Household Income (White) 630. Median Household Income CI low (White) 631. Median Household Income CI high (White) 632. Living Wage raw value
633. Living Wage numerator 634. Living Wage denominator 635. Living Wage CI low 636. Living Wage CI high
637. Child Care Centers raw value 638. Child Care Centers numerator 639. Child Care Centers denominator 640. Child Care Centers CI low
641. Child Care Centers CI high 642. Residential Segregation - Black/White raw value643. Residential Segregation - Black/White numerator644. Residential Segregation - Black/White denominator
645. Residential Segregation - Black/White CI low646. Residential Segregation - Black/White CI high647. Homicides raw value 648. Homicides numerator
649. Homicides denominator 650. Homicides CI low 651. Homicides CI high 652. Homicides (AIAN)
653. Homicides CI low (AIAN) 654. Homicides CI high (AIAN) 655. Homicides (Asian) 656. Homicides CI low (Asian)
657. Homicides CI high (Asian) 658. Homicides (Black) 659. Homicides CI low (Black) 660. Homicides CI high (Black)
661. Homicides (Hispanic) 662. Homicides CI low (Hispanic) 663. Homicides CI high (Hispanic) 664. Homicides (White)
665. Homicides CI low (White) 666. Homicides CI high (White) 667. Homicides (NHOPI) 668. Homicides CI low (NHOPI)
669. Homicides CI high (NHOPI) 670. Motor Vehicle Crash Deaths raw value 671. Motor Vehicle Crash Deaths numerator 672. Motor Vehicle Crash Deaths denominator
673. Motor Vehicle Crash Deaths CI low 674. Motor Vehicle Crash Deaths CI high 675. Motor Vehicle Crash Deaths (AIAN) 676. Motor Vehicle Crash Deaths CI low (AIAN)
677. Motor Vehicle Crash Deaths CI high (AIAN)678. Motor Vehicle Crash Deaths (Asian) 679. Motor Vehicle Crash Deaths CI low (Asian)680. Motor Vehicle Crash Deaths CI high (Asian)
681. Motor Vehicle Crash Deaths (Black) 682. Motor Vehicle Crash Deaths CI low (Black)683. Motor Vehicle Crash Deaths CI high (Black)684. Motor Vehicle Crash Deaths (Hispanic)
685. Motor Vehicle Crash Deaths CI low (Hispanic)686. Motor Vehicle Crash Deaths CI high (Hispanic)687. Motor Vehicle Crash Deaths (White) 688. Motor Vehicle Crash Deaths CI low (White)
689. Motor Vehicle Crash Deaths CI high (White)690. Motor Vehicle Crash Deaths (NHOPI) 691. Motor Vehicle Crash Deaths CI low (NHOPI)692. Motor Vehicle Crash Deaths CI high (NHOPI)
693. Firearm Fatalities raw value 694. Firearm Fatalities numerator 695. Firearm Fatalities denominator 696. Firearm Fatalities CI low
697. Firearm Fatalities CI high 698. Firearm Fatalities (AIAN) 699. Firearm Fatalities CI low (AIAN) 700. Firearm Fatalities CI high (AIAN)
701. Firearm Fatalities (Asian) 702. Firearm Fatalities CI low (Asian) 703. Firearm Fatalities CI high (Asian) 704. Firearm Fatalities (Black)
705. Firearm Fatalities CI low (Black) 706. Firearm Fatalities CI high (Black) 707. Firearm Fatalities (Hispanic) 708. Firearm Fatalities CI low (Hispanic)
709. Firearm Fatalities CI high (Hispanic) 710. Firearm Fatalities (White) 711. Firearm Fatalities CI low (White) 712. Firearm Fatalities CI high (White)
713. Firearm Fatalities (NHOPI) 714. Firearm Fatalities CI low (NHOPI) 715. Firearm Fatalities CI high (NHOPI) 716. Disconnected Youth raw value
717. Disconnected Youth numerator 718. Disconnected Youth denominator 719. Disconnected Youth CI low 720. Disconnected Youth CI high
721. Lack of Social and Emotional Support raw value722. Lack of Social and Emotional Support numerator723. Lack of Social and Emotional Support denominator724. Lack of Social and Emotional Support CI low
725. Lack of Social and Emotional Support CI high726. % Below 18 Years of Age raw value 727. % Below 18 Years of Age numerator 728. % Below 18 Years of Age denominator
729. % Below 18 Years of Age CI low 730. % Below 18 Years of Age CI high 731. % 65 and Older raw value 732. % 65 and Older numerator
733. % 65 and Older denominator 734. % 65 and Older CI low 735. % 65 and Older CI high 736. % Female raw value
737. % Female numerator 738. % Female denominator 739. % Female CI low 740. % Female CI high
741. % American Indian or Alaska Native raw value742. % American Indian or Alaska Native numerator743. % American Indian or Alaska Native denominator744. % American Indian or Alaska Native CI low
745. % American Indian or Alaska Native CI high746. % Asian raw value 747. % Asian numerator 748. % Asian denominator
749. % Asian CI low 750. % Asian CI high 751. % Hispanic raw value 752. % Hispanic numerator
753. % Hispanic denominator 754. % Hispanic CI low 755. % Hispanic CI high 756. % Native Hawaiian or Other Pacific Islander raw value
757. % Native Hawaiian or Other Pacific Islander numerator758. % Native Hawaiian or Other Pacific Islander denominator759. % Native Hawaiian or Other Pacific Islander CI low760. % Native Hawaiian or Other Pacific Islander CI high
761. % Non-Hispanic Black raw value 762. % Non-Hispanic Black numerator 763. % Non-Hispanic Black denominator 764. % Non-Hispanic Black CI low
765. % Non-Hispanic Black CI high 766. % Non-Hispanic White raw value 767. % Non-Hispanic White numerator 768. % Non-Hispanic White denominator
769. % Non-Hispanic White CI low 770. % Non-Hispanic White CI high 771. % Disability: Functional Limitations raw value772. % Disability: Functional Limitations numerator
773. % Disability: Functional Limitations denominator774. % Disability: Functional Limitations CI low775. % Disability: Functional Limitations CI high776. % Not Proficient in English raw value
777. % Not Proficient in English numerator 778. % Not Proficient in English denominator 779. % Not Proficient in English CI low 780. % Not Proficient in English CI high
781. Children in Single-Parent Households raw value782. Children in Single-Parent Households numerator783. Children in Single-Parent Households denominator784. Children in Single-Parent Households CI low
785. Children in Single-Parent Households CI high786. % Rural raw value 787. % Rural numerator 788. % Rural denominator
789. % Rural CI low 790. % Rural CI high 791. Population raw value 792. Population numerator
793. Population denominator 794. Population CI low 795. Population CI high
11.2. County Age-Sex Data#
11.3. County Age-Sex Data#
agesex_df.iloc[40:60]
| IBRC_Geo_ID | Statefips | Countyfips | Description | Year | Total Population | Population 0-4 | Population 5-17 | Population 18-24 | Population 25-44 | Population 45-64 | Population 65+ | Population Under 18 | Population 18-54 | Population 55+ | Male Population | Female Population | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 40 | 1000 | 1 | 0 | Alabama | 2015 | 4854803 | 294097 | 809062 | 471910 | 1230689 | 1286744 | 762301 | 1103159 | 2351777 | 1399867.0 | 2352806 | 2501997 |
| 41 | 1000 | 1 | 0 | Alabama | 2016 | 4866824 | 294616 | 805845 | 462098 | 1231213 | 1289047 | 784005 | 1100461 | 2337301 | 1429062.0 | 2357211 | 2509613 |
| 42 | 1000 | 1 | 0 | Alabama | 2017 | 4877989 | 294572 | 802005 | 455547 | 1233167 | 1287432 | 805266 | 1096577 | 2325223 | 1456189.0 | 2360503 | 2517486 |
| 43 | 1000 | 1 | 0 | Alabama | 2018 | 4891628 | 295520 | 797079 | 453230 | 1236516 | 1282303 | 826980 | 1092599 | 2316986 | 1482043.0 | 2365445 | 2526183 |
| 44 | 1000 | 1 | 0 | Alabama | 2019 | 4907965 | 294274 | 794453 | 450764 | 1242294 | 1274660 | 851520 | 1088727 | 2309910 | 1509328.0 | 2371832 | 2536133 |
| 45 | 1000 | 1 | 0 | Alabama | 2020 | 5033094 | 297347 | 832329 | 467246 | 1270670 | 1299444 | 866058 | 1129676 | 2364124 | 1539193.0 | 2446816 | 2586278 |
| 46 | 1000 | 1 | 0 | Alabama | 2021 | 5049196 | 294227 | 833920 | 475424 | 1277137 | 1287898 | 880590 | 1128147 | 2372657 | 1550979.0 | 2453002 | 2596194 |
| 47 | 1000 | 1 | 0 | Alabama | 2022 | 5076181 | 293480 | 836216 | 478391 | 1285214 | 1279704 | 903176 | 1129696 | 2382840 | 1566349.0 | 2465853 | 2610328 |
| 48 | 1000 | 1 | 0 | Alabama | 2023 | 5117673 | 294447 | 839471 | 482743 | 1296732 | 1274413 | 929867 | 1133918 | 2399292 | 1586378.0 | 2484555 | 2633118 |
| 49 | 1000 | 1 | 0 | Alabama | 2024 | 5157699 | 295446 | 839411 | 488175 | 1309411 | 1269355 | 955901 | 1134857 | 2417153 | 1605689.0 | 2503170 | 2654529 |
| 50 | 1001 | 1 | 1 | Autauga County, AL | 2000 | 44021 | 3029 | 9538 | 3520 | 13444 | 9959 | 4531 | 12567 | 22673 | 8781.0 | 21385 | 22636 |
| 51 | 1001 | 1 | 1 | Autauga County, AL | 2001 | 44889 | 3120 | 9574 | 3654 | 13507 | 10367 | 4667 | 12694 | 23155 | 9040.0 | 21813 | 23076 |
| 52 | 1001 | 1 | 1 | Autauga County, AL | 2002 | 45909 | 3191 | 9864 | 3661 | 13696 | 10680 | 4817 | 13055 | 23444 | 9410.0 | 22362 | 23547 |
| 53 | 1001 | 1 | 1 | Autauga County, AL | 2003 | 46800 | 3192 | 10110 | 3768 | 13713 | 11023 | 4994 | 13302 | 23783 | 9715.0 | 22760 | 24040 |
| 54 | 1001 | 1 | 1 | Autauga County, AL | 2004 | 48366 | 3353 | 10389 | 4015 | 13958 | 11461 | 5190 | 13742 | 24593 | 10031.0 | 23512 | 24854 |
| 55 | 1001 | 1 | 1 | Autauga County, AL | 2005 | 49676 | 3487 | 10662 | 4100 | 14114 | 11940 | 5373 | 14149 | 25121 | 10406.0 | 24200 | 25476 |
| 56 | 1001 | 1 | 1 | Autauga County, AL | 2006 | 51328 | 3492 | 10947 | 4255 | 14497 | 12467 | 5670 | 14439 | 25973 | 10916.0 | 24988 | 26340 |
| 57 | 1001 | 1 | 1 | Autauga County, AL | 2007 | 52405 | 3485 | 11264 | 4290 | 14584 | 12931 | 5851 | 14749 | 26384 | 11272.0 | 25468 | 26937 |
| 58 | 1001 | 1 | 1 | Autauga County, AL | 2008 | 53277 | 3437 | 11411 | 4427 | 14615 | 13331 | 6056 | 14848 | 26845 | 11584.0 | 25873 | 27404 |
| 59 | 1001 | 1 | 1 | Autauga County, AL | 2009 | 54135 | 3584 | 11312 | 4545 | 14637 | 13715 | 6342 | 14896 | 27213 | 12026.0 | 26364 | 27771 |
11.4. County Race Data#
race_df.head()
| IBRC_Geo_ID | Statefips | Countyfips | Description | Year | Total Population | White Alone | Black Alone | American Indian or Alaskan Native | Asian Alone | Hawaiian or Pacific Islander Alone | Two or More Races | Not Hispanic | Hispanic | |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 0 | 0 | 0 | 0 | U.S. | 1990 | 249622814 | 209366661.0 | 30648345.0 | 2058726.0 | 7549082.0 | NaN | NaN | 227049976.0 | 22572838.0 |
| 1 | 0 | 0 | 0 | U.S. | 1991 | 252980941 | 211606011.0 | 31290743.0 | 2126968.0 | 7957219.0 | NaN | NaN | 229425951.0 | 23554990.0 |
| 2 | 0 | 0 | 0 | U.S. | 1992 | 256514224 | 213945622.0 | 31979982.0 | 2202176.0 | 8386444.0 | NaN | NaN | 231894879.0 | 24619345.0 |
| 3 | 0 | 0 | 0 | U.S. | 1993 | 259918588 | 216187073.0 | 32634735.0 | 2282052.0 | 8814728.0 | NaN | NaN | 234141927.0 | 25776661.0 |
| 4 | 0 | 0 | 0 | U.S. | 1994 | 263125821 | 218304774.0 | 33258981.0 | 2361078.0 | 9200988.0 | NaN | NaN | 236179888.0 | 26945933.0 |
11.6. County Development Metrics Data#
dev_df.head()
| IBRC_Geo_ID | Statefips | Countyfips | Description | Year | M4D_Code | Code Description | M4D_Data | |
|---|---|---|---|---|---|---|---|---|
| 0 | 1001 | 1 | 1 | Autauga County, AL | 2019 | 100 | Headline M4D Index | 0.666112 |
| 1 | 1001 | 1 | 1 | Autauga County, AL | 2019 | 1000 | Full-Time Work | 0.661573 |
| 2 | 1001 | 1 | 1 | Autauga County, AL | 2019 | 10000 | Grocery stores per capita | 0.072548 |
| 3 | 1001 | 1 | 1 | Autauga County, AL | 2019 | 10100 | Farmers' markets per capita | 0.018166 |
| 4 | 1001 | 1 | 1 | Autauga County, AL | 2019 | 10200 | SNAP benefits per capita | 17.905272 |
# dev_df.drop_duplicates(inplace=True)
# dev_df.pivot(index = ['IBRC_Geo_ID', 'Year'], columns = 'Code Description', values = 'M4D_Data')