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