This question evaluates proficiency in data manipulation and basic statistical aggregation, particularly handling missing values and computing averages in Python. Commonly asked in technical interviews for Data Scientist roles within the Coding & Algorithms domain, it gauges practical application and robustness in data cleaning and edge-case handling rather than purely conceptual theory.
Given a Python list of dictionaries such as:
records = [{"name": "a", "income": 100}, {"name": "b", "income": None}, {"name": "a", "income": 200}]
Write a function that returns the average of all non-missing income values.
Requirements:
income
is
None
.
name
field does not affect the calculation.
None
.