Sectionย 1. Chapterย 7
single
Challenge: Cleaning Survey Data
Swipe to show menu
Task
Swipe to start coding
You are provided with a DataFrame containing survey responses, where some values in the 'age' and 'score' columns are missing. Your task is to implement a function that fills missing values in the 'age' column with the median age, and missing values in the 'score' column with the mean score. The function should return the cleaned DataFrame.
- Fill missing values in the 'age' column with the median of the 'age' column.
- Fill missing values in the 'score' column with the mean of the 'score' column.
- Return the resulting DataFrame.
Solution
Everything was clear?
Thanks for your feedback!
Sectionย 1. Chapterย 7
single
Ask AI
Ask AI
Ask anything or try one of the suggested questions to begin our chat