0
0
Pandasdata~10 mins

Detecting missing values with isna() in Pandas - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to check for missing values in the DataFrame column 'Age'.

Pandas
missing_ages = df['Age'].[1]()
Drag options to blanks, or click blank then click option'
Aisna
Bnotna
Cisnull
Dfillna
Attempts:
3 left
💡 Hint
Common Mistakes
Using fillna() which fills missing values instead of detecting them.
Using notna() which detects non-missing values.
2fill in blank
medium

Complete the code to count how many missing values are in the 'Salary' column.

Pandas
missing_count = df['Salary'].[1]().sum()
Drag options to blanks, or click blank then click option'
Adropna
Bfillna
Cnotna
Disna
Attempts:
3 left
💡 Hint
Common Mistakes
Using notna() which returns True for non-missing values.
Using dropna() which removes missing values instead of detecting them.
3fill in blank
hard

Fix the error in the code to correctly detect missing values in the DataFrame 'df'.

Pandas
missing_data = df.[1]()
Drag options to blanks, or click blank then click option'
Afillna
Bdropna
Cisna
Dnotna
Attempts:
3 left
💡 Hint
Common Mistakes
Using fillna() which fills missing values instead of detecting them.
Using dropna() which removes missing values.
4fill in blank
hard

Fill both blanks to create a dictionary with words as keys and the square of their length as values, only including words with length greater than 3.

Pandas
result = {word: len(word) [1] 2 for word in words if len(word) [2] 3}
Drag options to blanks, or click blank then click option'
A**
B>
C>=
D<
Attempts:
3 left
💡 Hint
Common Mistakes
Using '+' instead of '**' for power.
Using '<' instead of '>' for filtering.
5fill in blank
hard

Fill all three blanks to create a dictionary with uppercase keys, values from the original dict, and only include items with values greater than 0.

Pandas
result = [1]: [2] for k, v in data.items() if v [3] 0
Drag options to blanks, or click blank then click option'
Ak.upper()
Bv
C>
Dk
Attempts:
3 left
💡 Hint
Common Mistakes
Using k instead of k.upper() for keys.
Using '<' instead of '>' in the condition.