import pandas as pd df = pd.DataFrame({'A': [1, None, 3], 'B': [None, 2, 3]}) result = df['A'].isna() print(result)
The isna() function returns True for missing values and False otherwise. In column 'A', only the second row has None, so only index 1 is True.
import pandas as pd df = pd.DataFrame({'X': [1, 2, None, 4], 'Y': [None, None, 3, 4]}) missing_counts = df.isna().sum() print(missing_counts)
Column 'X' has one missing value (third row). Column 'Y' has two missing values (first and second rows). The sum() adds up True values from isna().
import pandas as pd import seaborn as sns import matplotlib.pyplot as plt df = pd.DataFrame({'A': [1, None, 3], 'B': [None, 2, None], 'C': [1, 2, 3]}) sns.heatmap(____, cbar=False) plt.show()
The isna() method returns a DataFrame of True/False indicating missing values. Passing this to sns.heatmap() colors missing spots. Other options either show non-missing or numeric sums, which are not suitable.
import pandas as pd df = pd.DataFrame({'A': [1, 2, 3]}) result = df.isna('A') print(result)
The isna() method does not accept any arguments. Passing 'A' causes a TypeError.
import pandas as pd df = pd.DataFrame({'X': [1, None, 3, None], 'Y': [None, 2, None, 4]})
Option A correctly uses isna() on each column and combines with | (OR) to filter rows where either column is missing. Option A is invalid syntax. Option A uses AND instead of OR. Option A filters rows where either column is NOT missing.