Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: Data Cleaning | Section
Practice
Projects
Quizzes & Challenges
Quizze
Challenges
/
Data Preprocessing and Feature Engineering

bookChallenge: Data Cleaning

Aufgabe

Swipe to start coding

You are given the Titanic dataset loaded through the Seaborn library. Your task is to clean the dataset using pandas by performing the following steps:

  1. Load the dataset with sns.load_dataset("titanic").
  2. Replace missing values in the column age with the column mean.
  3. Replace missing values in the column embarked with the most frequent value (mode).
  4. Remove duplicate rows.
  5. Remove outliers in the column fare using the IQR method.

Return the final cleaned dataset as a DataFrame named cleaned_data.

Lösung

War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 4
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

close

bookChallenge: Data Cleaning

Swipe um das Menü anzuzeigen

Aufgabe

Swipe to start coding

You are given the Titanic dataset loaded through the Seaborn library. Your task is to clean the dataset using pandas by performing the following steps:

  1. Load the dataset with sns.load_dataset("titanic").
  2. Replace missing values in the column age with the column mean.
  3. Replace missing values in the column embarked with the most frequent value (mode).
  4. Remove duplicate rows.
  5. Remove outliers in the column fare using the IQR method.

Return the final cleaned dataset as a DataFrame named cleaned_data.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 4
single

single

some-alt