CommencerCommencer gratuitement

Replacing hidden missing values

In the previous two exercises, you worked on identifying and handling missing values while importing a dataset. In this exercise, you will work on identifying hidden missing values in your data and handling them. You'll use the diabetes dataset which has already been loaded for you.

The diabetes DataFrame has 0's in the column BMI. But BMI cannot be 0. It should instead be NaN. In this exercise, you'll learn to identify such discrepancies. You'll perform simple data analysis to catch missing values and replace them. Both numpy and pandas have been imported into your DataFrame as np and pd respectively.

Additionally, you can play around with the dataset like printing it's .head(), .info() etc. to get more familiar with the dataset.

Cet exercice fait partie du cours

Dealing with Missing Data in Python

Afficher le cours

Exercice interactif pratique

Essayez cet exercice en complétant cet exemple de code.

# Print the description of the data
print(___)
Modifier et exécuter le code