You are given a DataFrame df with three columns:
name: a string that may contain leading/trailing spaces and inconsistent capitalization.date: a string representing a calendar date in a parseable but messy form (e.g. extra whitespace, single-digit month/day).value: a numeric column that may contain missing values.Write a function solution(df) that returns a cleaned DataFrame produced by the following pipeline, applied in this exact order:
name and convert each name to title case (first letter of each word uppercase, the rest lowercase).date to the standardized string format YYYY-MM-DD.value with the mean of the non-missing value entries that remain after step 3.Return the resulting DataFrame.