Your question is Python Data Cleaning Function. 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.
Write a Python function that processes a given dataset and returns the cleaned version.
For grading, treat dataset as a list of dictionaries with string keys. Return a new list where string values are stripped of leading and trailing whitespace, and fields with None or empty string values are removed. Preserve record order and do not mutate the input.
def clean_dataset(dataset):