Recall & Review
beginner
What do the functions
isnull() and isna() do in pandas?Both
isnull() and isna() check for missing values in a DataFrame or Series. They return a new object of the same shape with True where the data is missing and False where it is present.Click to reveal answer
beginner
How can you use
isnull() to find how many missing values are in each column of a DataFrame?You can call
df.isnull().sum(). This returns a Series with the count of missing values for each column in the DataFrame df.Click to reveal answer
beginner
Are
isnull() and isna() different in pandas?No, they are exactly the same.
isna() is just an alias for isnull(). You can use either one to detect missing values.Click to reveal answer
beginner
What type of values do
isnull() and isna() detect as missing?They detect
NaN (Not a Number), None, and other null-like values as missing in pandas objects.Click to reveal answer
intermediate
How would you filter rows in a DataFrame to keep only those with missing values in a specific column?
Use
df[df['column_name'].isnull()]. This returns rows where the specified column has missing values.Click to reveal answer
Which pandas function can you use to detect missing values in a DataFrame?
✗ Incorrect
isnull() returns a boolean mask showing missing values. fillna() fills missing values, dropna() removes them, and replace() replaces values.What does
df.isnull().sum() return?✗ Incorrect
It returns a Series with the count of missing values for each column.
Are
isnull() and isna() different functions?✗ Incorrect
isna() is an alias for isnull(). Both behave identically.Which of these values is detected as missing by
isnull()?✗ Incorrect
NaN is recognized as missing. Zero, empty string, and False are not missing.How to select rows where column 'Age' has missing values?
✗ Incorrect
Using
df[df['Age'].isnull()] filters rows where 'Age' is missing.Explain how to identify missing values in a pandas DataFrame using
isnull() or isna().Think about how to get a True/False map and then count Trues.
You got /3 concepts.
Describe how to filter rows in a DataFrame to keep only those with missing data in a specific column.
Focus on selecting rows where a column is missing.
You got /2 concepts.