Chapter 1 · Section 4 practice

Pandas Series

Work from question 1 to 10. Edit your Python box, click Run Code, review the result, then click Submit attempt. Reference answers unlock after all ten attempts are submitted. This records completion, not correctness. Each box runs independently. Progress is saved in this browser.

Submitted: 0 / 10

1. Create labels

Warm-up. Create a Series of [100, 120, 110] labelled Mon, Tue, Wed, and print it.

Write your answer, then run it.

2. Select a label

Warm-up. Print Tue using loc and the first observation using iloc.

Write your answer, then run it.

3. Summarize totals

Warm-up. Print the sum and mean of this Series.

Write your answer, then run it.

4. Interpret describe

Build your skills. Use describe to print its count and 50% values. Explain 50% in a comment.

Write your answer, then run it.

5. Select high days

Build your skills. Print only values above 110, keeping their day labels.

Write your answer, then run it.

6. Rank days

Build your skills. Print the Series in descending order and the label of its largest value.

Write your answer, then run it.

7. Count order types

Build your skills. Print value_counts for Tea/Coffee orders, then print the Tea count alone.

Write your answer, then run it.

8. Match standard deviations

Challenge. Print pandas default std and NumPy std with a matching ddof, both to three decimals.

Write your answer, then run it.

9. Align dish labels

Challenge. Calculate count × bill with the Series below. Print the result and explain why differently ordered labels still pair correctly.

Write your answer, then run it.

10. Interpret revenue shares

Challenge. Calculate the revenue share for each dish, in percent. Print shares rounded to one decimal, then explain in a comment why this does not measure profit share.

Write your answer, then run it.

Reference answers are locked until all 10 attempts are submitted.