Data Analysis with Python: From Raw Data to Real-World Insights
BOOK 2 · PROJECTS · CHAPTER 17

Chapter 17 exercises: Independent Data Analysis Capstone

On this page

Attempt these tasks before opening the worked answers. Use the chapter experiment notebook, or import NumPy as np and Pandas as pd in your own notebook. Retain your first attempt and explain each correction.

B2-17-E01 · Check common endpoint coverage

Identify the country lacking the baseline before reporting common-period changes.

df=pd.DataFrame({"country":["A","A","B"],"year":[2018,2023,2023],"value":[10,12,8]})
One hint after an attempt

Inspect the pivoted endpoint columns.

B2-17-E02 · Compare absolute and relative change

Compute both change measures and explain the different rankings.

start=np.array([100.,10.]);end=np.array([110.,15.])
One hint after an attempt

Keep the baseline visible.

B2-17-E03 · Reject an unsupported causal claim

Compute the descriptive change and state why these two totals cannot identify a policy effect.

findings={"population_2018":100,"population_2023":110}
One hint after an attempt

What would have happened without the policy?

Reflect and get feedback

Explain one result without looking at the code. Identify one boundary case that would change your method. An optional tutor prompt is: “Here is my attempt at B2-17-E03. Give one hint about the violated assumption; do not give the solution yet.” Then use the worked answers.

Teaching edition · verified experiments · PDF and EPUB editions not generated.