Validating Engineering Data Imported with Python
Validate required columns and normalize units explicitly. Use the example below to practice the review and record an output that another reviewer can reproduce.
Inputs and Prerequisites
A small CSV fixture, expected headers and rules for identifiers, units and missing fields.
Review Workflow
- CSV fields
- Validation
- Unit conversion
- Batch totals
- Validate required columns and normalize units explicitly.
- Reject duplicates or missing identifiers before computing totals.
- Keep invalid rows and their reasons in the batch result.
Worked Example
Three data rows record 1.2 kN, 300 N and a blank under a known unit field. The first two give 1.50 kN after conversion. Report two usable rows and one blank instead of treating the blank as zero.
Output Checks and Common Errors
Verify row counts, field mapping and round-trip results with a tiny fixture before processing real exports.
Official References
- Python CSV documentation
Review how rows and fields are parsed before applying engineering validation.