Your question is Deduplicate and Impute Data. 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.
Deutsche Telekom data pipelines receive records with inconsistent fields and repeated entries. Implement a function that normalizes missing values, identifies duplicates using one or more key fields, and separates records whose key is incomplete.
Given records, a list of dictionaries, and key_fields, a list of field names:
None, or an empty string as a missing value.None for missing values.key_fields as a composite key.missing_key_records.unique_records. Place later occurrences in duplicates.unique_records, duplicates, and missing_key_records.All non-missing field values are hashable. Preserve each record's values and field names apart from adding missing fields with None.
def classify_records(records, key_fields):