Challenge: Data Cleaning
Uppgift
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:
- Load the dataset with
sns.load_dataset("titanic"). - Replace missing values in the column
agewith the column mean. - Replace missing values in the column
embarkedwith the most frequent value (mode). - Remove duplicate rows.
- Remove outliers in the column
fareusing the IQR method.
Return the final cleaned dataset as a DataFrame named cleaned_data.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 4
single
Fråga AI
Fråga AI
Fråga vad du vill eller prova någon av de föreslagna frågorna för att starta vårt samtal
Fantastiskt!
Completion betyg förbättrat till 8.33
Challenge: Data Cleaning
Svep för att visa menyn
Uppgift
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:
- Load the dataset with
sns.load_dataset("titanic"). - Replace missing values in the column
agewith the column mean. - Replace missing values in the column
embarkedwith the most frequent value (mode). - Remove duplicate rows.
- Remove outliers in the column
fareusing the IQR method.
Return the final cleaned dataset as a DataFrame named cleaned_data.
Lösning
Var allt tydligt?
Tack för dina kommentarer!
Avsnitt 1. Kapitel 4
single