Chapter 2 · Section 6 practice

Business Charts

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. Totals by category

Warm-up. Use loc to select Gifts and Accessories separately; print total Revenue for each.

Write your answer, then run it.

2. Averages by category

Warm-up. Use loc to select each category separately; print its mean Revenue.

Write your answer, then run it.

3. Number of orders

Warm-up. Print the number of rows in each category.

Write your answer, then run it.

4. Available observations

Build your skills. Print group size and non-missing revenue counts.

Write your answer, then run it.

5. Several summaries

Build your skills. Select each category separately with loc. Print its revenue count, sum, and mean.

Write your answer, then run it.

6. Different rankings

Build your skills. Print the category with the largest total, then the one with the largest mean.

Write your answer, then run it.

7. A labelled bar chart

Build your skills. Plot total category revenue as a bar chart. Add a title and both axis labels.

Write your answer, then run it.

8. A labelled histogram

Challenge. Plot this order-revenue distribution using three bins. Add a title and both axis labels.

Write your answer, then run it.

9. Group profit as well as revenue

Challenge. Calculate profit and print group totals for both Revenue and Profit.

Write your answer, then run it.

10. A supported explanation

Challenge. Calculate total revenue and print a finding that names Gifts, its total, and this four-order sample. Avoid making a coupon claim.

Write your answer, then run it.

Reference answers are locked until all 10 attempts are submitted.