A CSV import can quietly change the meaning of a benchmark before any analysis begins. The risk is especially easy to miss when a column looks like a Boolean but contains text, and an empty cell represents a verdict the measurement could not produce.

The open StagingBench dataset provides a useful example. Its scores.csv contains 120 scored tool and room pairs across 12 tools.

The interesting implementation detail is how to preserve the outcome states while loading the file. That matters whether the next consumer is a terminal report, a dashboard or an automated publishing job.

Start with the serialized values

Python's standard csv module returns strings. In this file, framing_pass contains "True", "False" or an empty string.

Do not write bool(row["framing_pass"]). A nonempty "False" string is truthy in Python. That conversion would silently classify recorded failures as successes.

An empty value needs its own treatment too. In the supplied records, it corresponds to unknown framing because alignment failed. Assigning it to the failure bucket would erase the distinction between a measured failure and an unavailable measurement.

Make the mapping explicit

Save the downloaded scores.csv in your working directory, then run this script. It reads the file and prints room identifiers followed by pass, fail and unknown counts. It creates no output files.

import csv from collections import Counter, defaultdict counts = defaultdict(Counter) with open("scores.csv", newline="", encoding="utf-8") as source: for row in csv.DictReader(source): state = { "True": "pass", "False": "fail", "": "unknown", }[row["framing_pass"]] counts[row["room"]][state] += 1 for room in sorted(counts): c = counts[room] print(room, c["pass"], c["fail"], c["unknown"]) total = sum(counts.values(), Counter()) print("TOTAL", total["pass"], total["fail"], total["unknown"]) 

The dictionary lookup is deliberate. An unexpected value raises an error instead of being silently accepted as another unknown. If a future export changes its serialization, the import should draw attention to that change.

Room identifiers remain strings. Keeping their leading zeroes makes them easier to match to the dataset's other records and filenames.

Check the accounting before interpreting it

Running this code against the supplied file prints a total line of TOTAL 69 25 26. Those categories account for all 120 rows, and every room has 12 of them.

A downstream report should retain the denominator alongside the outcome counts. If it calculates a percentage, it should also say whether unknowns remain in that denominator. A percentage among assessable outputs answers a different question from a percentage among all recorded outputs. Store the counts, preserve the unknown category and describe the denominator wherever a derived rate is displayed.

Keep drift attached to its status

The same care applies when extending the import to drift values. A numeric value in aligned_architecture_drift does not, by itself, establish that alignment succeeded.

Cross-checking the full records in all-scores.json finds 26 failed alignments. In all 26, architecture.aligned is false and drift_score equals raw_drift_score, with an architecture note describing an unaligned fallback.

That is a data interpretation issue, not a reason to discard the rows. Keep the numeric value together with alignment_ok, and distinguish fallback measurements when presenting or comparing drift. Otherwise a chart can make unlike measurements look interchangeable merely because both parse as numbers.

The methodology explains the measurement context. The loader's responsibility is more modest: preserve what was recorded, make unexpected inputs visible and avoid manufacturing certainty during conversion.