0
0
Data Analysis Pythondata~10 mins

Identifying missing values (isnull, isna) in Data Analysis Python - 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'.

Data Analysis Python
missing_ages = df['Age'].[1]()
Drag options to blanks, or click blank then click option'
Amean
Bsum
Cisnull
Dcount
Attempts:
3 left
💡 Hint
Common Mistakes
Using sum() instead of isnull() to identify missing values.
Using count() which counts non-missing values.
Using mean() which calculates average, not missing values.
2fill in blank
medium

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

Data Analysis Python
missing_salary_count = df['Salary'].[1]().sum()
Drag options to blanks, or click blank then click option'
Aisna
Bcount
Cmean
Dfillna
Attempts:
3 left
💡 Hint
Common Mistakes
Using count() which counts non-missing values.
Using mean() which calculates average, not missing values.
Using fillna() which replaces missing values instead of detecting them.
3fill in blank
hard

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

Data Analysis Python
missing_data = df.[1]()
Drag options to blanks, or click blank then click option'
Aisnull
Bisna
Cmissing
Dnull
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'missing' or 'null' which are not pandas methods.
Confusing isna() and isnull() - both work but isnull() is more common.
4fill in blank
hard

Fill both blanks to create a dictionary with words as keys and their lengths only if length is greater than 3.

Data Analysis Python
lengths = {word: [1] for word in words if [2]
Drag options to blanks, or click blank then click option'
Alen(word)
Bword
Clen(word) > 3
Dword > 3
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'word > 3' which compares string to number and causes error.
Using 'word' as value instead of length.
Not filtering words by length.
5fill in blank
hard

Fill all three blanks to create a dictionary with uppercase keys and values only if value is greater than 0.

Data Analysis Python
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.lower()
Attempts:
3 left
💡 Hint
Common Mistakes
Using k.lower() instead of k.upper() for keys.
Using '<' instead of '>' in condition.
Using k or v incorrectly in keys or values.