Core pandas · Lesson 7 of 10
Data types and missing values
Types and missing data
Two things trip up every new analyst: data types and missing values.
- Every column has a type, its
dtype: whole numbers, decimals, text, and so on. Check them withdf.dtypes. - Missing values show up as
NaN. Find them withisnull(), and handle them withfillna()ordropna().
Python
Whether to drop missing data or fill it is a real judgment call you make as the analyst.
Exercise
Exercise — check your understanding
The scores DataFrame has a missing value. Replace every missing value with 0 and store the new DataFrame in fixed.
You’re reading for free. Sign in to keep your progress and earn a certificate when you finish.Sign in to keep my progress →