All problems

The Data Quality Scorecard

hardPythonData CleaningAggregation

Calderbrook Analytics finishes every column import with a scorecard, because knowing that a column loaded is not the same as knowing it can be used. The scorecard keeps three problems apart that look alike from a distance: a value that is a number and fine, a value the source deliberately marked as absent by writing NA, and a value that is neither — junk left behind by a broken export. A column can be entirely complete and still be useless, so the three are always reported separately.

Task: Print the scorecard for the column.

Input

The first line holds one integer n, how many values follow. Each of the next n lines holds one value: a number, the exact text NA, or arbitrary text that is neither.

Output

Four lines in this order: total and how many values there were, valid and how many were numbers, missing and how many were exactly NA, then corrupted and how many were neither. Each label is lowercase and separated from its number by a single space. The last three always add up to the first.

Example:

Input:
6
10
NA
abc
20.5
NA
xyz

Output:
total 6
valid 2
missing 2
corrupted 2

Sign in to solve this problem

Reading problems is free for everyone — solving them (Run, Submit, and tracking what you've solved) needs an account.

Sign in

Discussion

Sign in to join the discussion — reading is open to everyone.

Loading comments…