Your question is SQL Missing Values Count. Start with the requirements on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
For a BCG X analytics workflow, records may contain incomplete values before they are processed. Given a collection of row records and a target column name, return how many rows have a missing value in that column.
Treat a value as missing when the column is absent from a row or its value is None. Do not treat valid values such as 0, False, or an empty string as missing.
Implement count_missing_values(rows, column):
rows is a list of dictionaries, where each dictionary represents one record.column is a string naming the column to inspect.column is absent or mapped to None.def count_missing_values(rows, column):