Pandas 0 to Infinity · Intermediate project

Competitive Exam Analysis

Six stages: response validation, key merging, negative marks, subject breakdown, accuracy and rank list

Intermediate+ · multi-file joins, scoring policy, GroupBy, ranking · 6 executable CSV stages

Your project brief

Build a reproducible exam-scoring engine with explicit negative marking and accuracy rules.

Your task is to run each stage separately, explain the columns it creates, inspect the output CSV, and verify that the following stage consumes that exact file. A complete worked solution is provided alongside the exercises.

Six-stage processing sequence

  1. Stage 01 — Validate candidate responses

    Merge candidate details, standardise choices and prevent double answers.

    input/responses.csv → output/stage01.csv

    Run stage 01.py · Processing function · Inspect output CSV

  2. Stage 02 — Merge answer key

    Check every question and join subject, correct answer and scoring rules.

    output/stage01.csv → output/stage02.csv

    Run stage 02.py · Processing function · Inspect output CSV

  3. Stage 03 — Score responses

    Give +marks for correct answers, −penalty for wrong, and zero for skipped.

    output/stage02.csv → output/stage03.csv

    Run stage 03.py · Processing function · Inspect output CSV

  4. Stage 04 — Analyse subjects

    Summarise each candidate's correct, wrong, skipped and awarded marks by subject.

    output/stage03.csv → output/stage04.csv

    Run stage 04.py · Processing function · Inspect output CSV

  5. Stage 05 — Aggregate candidates

    Combine subject totals to overall score, attempted accuracy and final rank.

    output/stage04.csv → output/stage05.csv

    Run stage 05.py · Processing function · Inspect output CSV

  6. Stage 06 — Publish merit list

    Sort by rank, generate the final candidate report.csv.

    output/stage05.csv → output/report.csv

    Run stage 06.py · Processing function · Inspect output CSV

Interactive CSV Pipeline Inspector

See what each stage reads and writes

Choose a stage. The table on the left shows the real source CSV; the table on the right shows the committed output CSV snapshot. Run the Python scripts locally to recreate these files.

Choose a stage to inspect the CSV data.

Input CSV

Open input CSV
Loading input…

Output CSV

Open output CSV
Loading output…

CSV snapshots are read-only and are hosted with the lesson. The browser does not execute Python or edit repository data. Inspecting a file is separate from running the local pipeline.

Sample inputs and expected results

Every file is real, readable CSV. Open these files directly or use the browser's save function; no account is required.

Terminal · complete run
python -m pip install pandas
cd python/pandas/projects/csv-pipelines/exam-analysis
python run_pipeline.py
python -m unittest discover -s . -p "test_*.py"

Learn from each step instead of running everything blindly. The output CSV from one stage should become the next script's input.

Student exercises and assessment

  1. Run all six stages one by one and explain each CSV transformation.
  2. Identify two new columns added between Stage 2 and Stage 4.
  3. Modify a copy of the first input file and predict how the final report will change.
  4. Create a log recording each stage's input rows, output rows and filename.
  5. Extend one stage to detect errors and write a rejected.csv file, without silently dropping incorrect records.
  6. Challenge: Try duplicate answers, unknown questions and invalid choices. Ensure unanswered questions score zero.
Open solution guidance

Study pipeline.py for the complete implementation. Use report.csv as a final comparison and run the test suite to verify important rules.

What happens after this project?

Repeat it with your own non-sensitive sample data. For the next challenge, keep invalid rows in a separate error file, add transaction dates, schedule recurring processing and compare runs over time.

Reference lessons: Data cleaning · Sorting and GroupBy · CSV read/write · Merge/concat.

← All CSV projectsExplore another project →