Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Cleaning Survey Data | Data Manipulation for Research
Python for Researchers

bookChallenge: Cleaning Survey Data

Opgave

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.

Løsning

Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 7
single

single

Spørg AI

expand

Spørg AI

ChatGPT

Spørg om hvad som helst eller prøv et af de foreslåede spørgsmål for at starte vores chat

close

bookChallenge: Cleaning Survey Data

Stryg for at vise menuen

Opgave

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.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 1. Kapitel 7
single

single

some-alt