Chapter 4 · Section 1 practice

Business Groups, Simple Rules, and Features

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. Count customers

Warm-up. Print the number of customer rows.

Write your answer, then run it.

2. Select spending features

Warm-up. Print the first two rows of the six spending columns.

Write your answer, then run it.

3. Identify coded categories

Warm-up. Print the unique Channel codes.

Write your answer, then run it.

4. Apply a simple rule

Build your skills. Count customers with Grocery at least 10,000 m.u.

Write your answer, then run it.

5. Count both rule groups

Build your skills. Print counts for both sides of the Grocery rule.

Write your answer, then run it.

6. Profile a rule

Build your skills. Print average Milk spending for both Grocery-rule groups.

Write your answer, then run it.

7. Change the rule

Build your skills. Count customers classified high at cutoffs 8,000 and 12,000.

Write your answer, then run it.

8. Check feature completeness

Challenge. Print the total missing entries in the selected feature table.

Write your answer, then run it.

9. Compare distribution spread

Challenge. Print the mean and sample SD of Fresh and Grocery.

Write your answer, then run it.

10. Separate inputs from interpretation

Challenge. Print whether Channel or Region appears in features; add a sentence about their later use.

Write your answer, then run it.

Reference answers are locked until all 10 attempts are submitted.