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

Chapter 1 exercises: Understanding Data Analysis

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-01-E01 · Define the denominator

Calculate the pooled attendance proportion. Report the denominator and explain why it is not a count of distinct people.

registered=[20,10,30]
attended=[15,9,18]
One hint after an attempt

Add the numerators and denominators separately.

B2-01-E02 · Investigate an impossible count

Reject this record before calculating a valid attendance rate. Explain the violated assumption.

registered=8
attended=11
One hint after an attempt

What subset relationship does the rate assume?

B2-01-E03 · Write a bounded comparison

Compute visits per open day for each period and identify the higher period. State why total visits answers a different question.

records=[{"period":"Jan","visits":10,"open_days":2},{"period":"Feb","visits":18,"open_days":6}]
One hint after an attempt

Name the exposure before dividing.

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-01-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.