A3 — Higher-order functions

Implement map, filter, and reduce from scratch, then use them to solve three small data-processing tasks.

Overview

Get comfortable with functions as values.

Part A — Build the primitives

In hof.py, implement my_map(f, xs), my_filter(p, xs), and my_reduce(f, xs, init). No use of the built-ins.

Part B — Apply them

Given records.csv from the starter repo:

  1. Compute the mean grade.
  2. Return the names of students who scored above the mean.
  3. Return the top-3 by score.

You may only iterate with the primitives you built in Part A.