Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Learn Challenge: Data Cleaning | Data Cleaning Essentials
Data Preprocessing and Feature Engineering

bookChallenge: Data Cleaning

Task

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.

Solution

Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 4
single

single

Ask AI

expand

Ask AI

ChatGPT

Ask anything or try one of the suggested questions to begin our chat

Suggested prompts:

Can you explain this in simpler terms?

What are the main points I should remember?

Can you give me an example?

close

Awesome!

Completion rate improved to 8.33

bookChallenge: Data Cleaning

Swipe to show menu

Task

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.

Solution

Switch to desktopSwitch to desktop for real-world practiceContinue from where you are using one of the options below
Everything was clear?

How can we improve it?

Thanks for your feedback!

SectionΒ 1. ChapterΒ 4
single

single

some-alt