Challenge: Cleaning Survey Data
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
Merci pour vos commentaires !
single
Demandez à l'IA
Demandez à l'IA
Posez n'importe quelle question ou essayez l'une des questions suggérées pour commencer notre discussion
Génial!
Completion taux amélioré à 5
Challenge: Cleaning Survey Data
Glissez pour afficher le menu
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
Merci pour vos commentaires !
single