0
0
Data Analysis Pythondata~10 mins

Handling missing values in Series 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 create a pandas Series with missing values.

Data Analysis Python
import pandas as pd
s = pd.Series([1, 2, [1], 4])
Drag options to blanks, or click blank then click option'
ANone
B5
C0
D3
Attempts:
3 left
💡 Hint
Common Mistakes
Using a number like 0 or 5 instead of a missing value placeholder.
Leaving the blank empty.
2fill in blank
medium

Complete the code to check for missing values in the Series.

Data Analysis Python
missing = s.[1]()
Drag options to blanks, or click blank then click option'
Anotnull
Bdropna
Cisnull
Dfillna
Attempts:
3 left
💡 Hint
Common Mistakes
Using notnull() which returns True for non-missing values.
Using fillna() or dropna() which modify the Series.
3fill in blank
hard

Fix the error in the code to fill missing values with zero.

Data Analysis Python
s_filled = s.[1](0)
Drag options to blanks, or click blank then click option'
Adropna
Bfillna
Creplace
Disnull
Attempts:
3 left
💡 Hint
Common Mistakes
Using dropna() which removes missing values instead of filling them.
Using replace() without specifying the missing value.
4fill in blank
hard

Fill both blanks to create a dictionary of word lengths for words longer than 3 characters.

Data Analysis Python
lengths = {word: [1] for word in words if len(word) [2] 3}
Drag options to blanks, or click blank then click option'
Alen(word)
B>
C<
Dword
Attempts:
3 left
💡 Hint
Common Mistakes
Using the word itself as the value instead of its length.
Using the wrong comparison operator.
5fill in blank
hard

Fill all three blanks to create a dictionary with uppercase keys and values greater than zero.

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
Attempts:
3 left
💡 Hint
Common Mistakes
Using original keys instead of uppercase keys.
Using wrong comparison operator or filtering condition.