0
0
Pandasdata~10 mins

Why handling missing data matters in Pandas - Test Your Understanding

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.

Pandas
missing = df.[1]()
Drag options to blanks, or click blank then click option'
Aisnull
Bdropna
Cfillna
Dhead
Attempts:
3 left
💡 Hint
Common Mistakes
Using dropna() removes rows instead of showing missing values.
Using fillna() replaces missing values but does not identify them.
2fill in blank
medium

Complete the code to remove rows with missing values from the DataFrame.

Pandas
clean_df = df.[1]()
Drag options to blanks, or click blank then click option'
Aisnull
Bdropna
Cinfo
Dfillna
Attempts:
3 left
💡 Hint
Common Mistakes
Using isnull() only identifies missing values but does not remove them.
Using fillna() replaces missing values but does not remove rows.
3fill in blank
hard

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

Pandas
df_filled = df.[1](0)
Drag options to blanks, or click blank then click option'
Adropna
Bisnull
Cfillna
Dreplace
Attempts:
3 left
💡 Hint
Common Mistakes
Using dropna() removes rows instead of filling missing values.
Using isnull() only checks for missing values but does not fill them.
4fill in blank
hard

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

Pandas
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 '<=' includes words with length 3 or less, which is not desired.
Using 'word' instead of 'len(word)' does not give the length.
5fill in blank
hard

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

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()' does not change key case.
Using '<' or '<=' includes values less than or equal to zero.
Using 'k' or 'v' incorrectly in the dictionary comprehension.