Appendix H — Practice Problem Solutions — Chapter 7
H.1 Solution Section 7.9.1
= pd.DataFrame(state_cancer_data) df
H.2 Solution Section 7.9.2
"Cancer Deaths Per 100k"] = df["Cancer Deaths"] / df["Population"] * 100_000 df[
H.3 Solution Section 7.9.3
"`Cancer Deaths Per 100k` >= 180 and `Median Household Income` < 68_500") df.query(
H.4 Solution Section 7.9.4
="scatter", x="Median Household Income", y="Cancer Deaths Per 100k") df.plot(kind
H.5 Solution Section 7.9.5
="scatter", x="Percent Aged 65+", y="Cancer Deaths Per 100k") df.plot(kind