Complete the code to fill missing values forward in the DataFrame column.
df['temperature'] = df['temperature'].[1]()
The ffill() method fills missing values by propagating the last valid observation forward.
Complete the code to fill missing values backward in the DataFrame column.
df['humidity'] = df['humidity'].[1]()
The bfill() method fills missing values by using the next valid observation backward.
Fix the error in the code to forward fill missing values in the DataFrame.
df['pressure'] = df['pressure'].fillna(method=[1])
The correct method argument for forward fill in fillna() is 'ffill'.
Fill both blanks to create a dictionary comprehension that maps words to their lengths only if length is greater than 3.
{word: [1] for word in words if [2]The dictionary comprehension maps each word to its length using len(word). The condition filters words with length greater than 3 using len(word) > 3.
Fill all three blanks to create a dictionary comprehension that maps uppercase words to their values only if the value is greater than 0.
{ [1]: [2] for [3], [2] in data.items() if [2] > 0 }The comprehension uses k.upper() as key, v as value, and iterates over k, v in data.items(). The condition filters values greater than 0.