2. Count and fill missing values
EasyPandas & NumPy
Rows have age and city, either of which may be None. Return a dict with missing (missing count per column, as a dict) and ages (the age column with missing values filled by the median age, as a list of floats).
Input rows arrive as a list of dictionaries; build a DataFrame with pd.DataFrame(rows).
Example 1
Input: [{'age': 30, 'city': 'Austin'}, {'age': None, 'city': None}, {'age': 40, 'city': 'Leeds'}]
Output: {'missing': {'age': 1, 'city': 1}, 'ages': [30.0, 35.0, 40.0]}Constraints
At least one age is present