Advertisement
Data Processing

The Placeholder Digit: In an IP Rating, the Letter X Is Not a Zero Waiting to Happen

What should a cleaning script do with the rating IPX8? The code is complete and meaningful as printed: the X says the product was not tested for solid...

What should a cleaning script do with the rating IPX8? The code is complete and meaningful as printed: the X says the product was not tested for solid-object ingress, and the 8 says it withstands continuous immersion. Trouble starts when a pipeline insists that both positions be digits. This batch's harness ran two common responses to that insistence over 19 IP codes: a strict parser that strips letters and demands two digits failed on all 7 X-forms, while a variant that replaces X with 0 parsed everything — and silently stamped 7 products with a solids rating of 0, the lowest the scale has, which none of them claims (Source: this batch's SD harness register, evidence/sd-results-batch53.json). This piece is the quick fix, in the order a practitioner should apply it.

What the harness does

The register for group AN168 holds 19 forms: twelve fully numeric codes (IP20 through IP69) and seven carrying an X in one position (IPX4, IPX5, IPX7, IPX8, IP6X, IP5X, IP4X). Ground truth is the published convention: the first character grades protection against solids on a 0–6 scale, the second grades protection against liquids on a 0–9 scale, and an X in either position records that the axis was not tested — an absence of a claim, not a claim of absence. Parser one strips non-digits and requires exactly two digits, recording anything else as a parse failure. Parser two replaces X with 0 so the field stays numeric. The harness scores each parser against the truth per form, and the two parsers' summaries are the story: identical success counts, opposite failure characters.

The Placeholder Digit: In an IP Rating, the Letter X Is Not a Zero Waiting to Happen

Symptom: one parser is loud, the other is wrong

Parser one's register line reads ok=12, wrong_value=0, parse_failure=7: it reads every numeric code correctly and refuses every X-form (Source: this batch's SD harness register). Parser two's line reads ok=12, wrong_value=7, parse_failure=0: it refuses nothing and is wrong seven times. A dashboard counting failures would rank parser two as the healthier pipeline — zero errors — while it manufactures a solids rating of 0 for IPX8, a rating that in the convention means no protection against solid objects at all, for a product whose maker simply did not test that axis. In a compliance column, that is the most damaging value the field could take: a procurement filter for "solids rating at least 4" would drop IPX8 products that were never assessed, and a safety summary would report tested-and-failed where the truth is untested.

Fix step one: keep the X as data

The repair begins by demoting the rating from a number to a pair of fields, each allowed three states: a digit, or untested. Stored that way, IPX8 is (untested, 8) and IP6X is (6, untested), and both survive import exactly. The change is small and entirely at the schema level: two short columns, or one text column kept verbatim, instead of one integer. Every downstream failure in the register traces to refusing this step — the parsers did not misread the codes; the target field could not hold what the codes say.

Fix step two: never let a placeholder become a measurement

If a legacy column absolutely requires digits, the defensible filler is a null, not a 0. Zero is a measurement on this scale — the bottom of it — and substituting it converts "not tested" into "tested, worst result," which the register counts, correctly, as a wrong value seven times out of seven (Source: this batch's SD harness register). The same logic guards the liquids axis: IP6X zero-filled becomes (6, 0), claiming no water protection for a product whose dust rating of 6 is the scale's maximum and whose water axis is simply unreported. A placeholder that lands inside the measured range will eventually be averaged, filtered or certified as if it were data; a null can be none of those things.

Fix step three: read the two axes independently downstream

With the pair preserved, consumers of the column must also change: a filter on water resistance should test the second field only, leaving IPX4, IPX5, IPX7 and IPX8 in contention regardless of their untested solids axis, and a filter on dust should test the first field only. Concatenating the pair into a single sortable number — 68 above 67 above 65 — is a third, quieter distortion the harness does not score but the register's truth table makes visible: IP69 and IP68 differ in kind of water test, not merely in degree, and the pair representation is what keeps that visible. The fix is complete when no stage of the pipeline ever holds the rating as one number.

Worked identifications: three codes read end to end

IPX8 first. Truth: solids untested, liquids 8. Parser one strips to a single digit and fails; parser two zero-fills to (0, 8) and is wrong on the solids axis. Read properly, the code certifies immersion performance and says nothing about dust. IP6X is the mirror: truth (6, untested) — the maximum dust grade, no water claim — which zero-filling degrades to (6, 0). IP65, fully numeric, is the control: both parsers return (6, 5), the register's ok outcome, showing that the group's entire failure population is the X-forms and nothing else. All three rows were round-tripped through the harness before drafting, and the register's per-form rows match these readings.

What this group adds to the cleaning rules

Some fields that look numeric are verdicts with a vocabulary, and the vocabulary includes a word for "we did not test this." The register's paired summaries make the general point measurable: two parsers with identical ok counts can differ completely in trustworthiness, because one concentrates its trouble in visible failures and the other dissolves its trouble into plausible values. When a code family contains a placeholder character, the placeholder is part of the data model. Cleaning that deletes it or converts it has not cleaned the data; it has edited the claims.

How this group's counts were verified

The harness was run twice and produced byte-identical result files (sha256 68d73ec714c1dc091b3e1ccf7dbb5c276823e522a77cd6c7a8964bf0c63b1968); the counts quoted — 19 forms, 12 numeric, 7 X-forms, parser summaries of 12/0/7 and 12/7/0 across ok, wrong-value and parse-failure — are read from that output. The truth table is the harness's own encoding of the IP convention, applied by script to every form. The three worked codes were drawn from the register's rows after the run and re-verified against them before this text was written.

Frequently asked questions

Q: How many IP codes are in the group, and how many carry an X? A: Nineteen forms, of which seven carry an X in one position — IPX4, IPX5, IPX7, IPX8, IP6X, IP5X and IP4X (Source: this batch's SD harness register, evidence/sd-results-batch53.json).

Q: What does the X in an IP rating mean? A: That the axis was not tested. The first position grades solids from 0 to 6 and the second grades liquids from 0 to 9; an X records no claim on that axis, which is different from a grade of 0.

Q: Why is replacing X with 0 worse than failing to parse? A: Because 0 is a real grade — the lowest. Zero-filling converts seven untested axes into seven worst-possible results, and the harness counts all seven as wrong values; the strict parser's seven failures at least announce themselves.

Q: Can an IP rating be stored as a single number? A: Not without loss. The pair (solids, liquids) with an explicit untested state is the smallest faithful form; a single number cannot represent IPX8 or IP6X at all.

Red line: a placeholder character in a rating code is a statement about testing, and any cleaning step that turns it into the scale's lowest grade has fabricated a test result.

Know someone who needs this? Share it.

Advertisement