0
0
Pandasdata~5 mins

Detecting missing values with isna() in Pandas - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What does the isna() function do in pandas?

The isna() function checks each value in a pandas DataFrame or Series and returns True if the value is missing (NaN), otherwise False.

Click to reveal answer
beginner
How can you use isna() to find missing values in a DataFrame?

Call isna() on the DataFrame. It returns a DataFrame of the same shape with True where values are missing and False elsewhere.

Click to reveal answer
beginner
What type of output does isna() produce when used on a pandas Series?

It produces a Series of boolean values, where each element is True if the original value is missing, and False if it is present.

Click to reveal answer
intermediate
Can isna() detect missing values represented as None in pandas?

Yes, isna() treats both None and NaN as missing values and returns True for them.

Click to reveal answer
beginner
How is isna() different from notna() in pandas?

isna() returns True for missing values, while notna() returns True for non-missing values.

Click to reveal answer
What does df.isna() return when called on a pandas DataFrame df?
AA DataFrame of booleans showing where values are missing
BA count of missing values in each column
CA DataFrame with missing values replaced by zeros
DA list of column names with missing values
Which of these values will isna() mark as missing in pandas?
ANone
B"" (empty string)
C0
DFalse
If series is a pandas Series, what is the type of series.isna()?
ADataFrame of booleans
BSeries of booleans
CList of missing values
DInteger count of missing values
Which pandas function gives the opposite result of isna()?
Afillna()
Bdropna()
Cisnull()
Dnotna()
What will df.isna().sum() do?
AReplace missing values with sum
BReturn total number of rows
CCount missing values in each column
DDrop rows with missing values
Explain how you would use pandas to find missing values in a dataset.
Think about a function that marks missing spots with True.
You got /4 concepts.
    Describe the difference between isna() and notna() in pandas.
    One finds missing, the other finds present values.
    You got /3 concepts.