Complete the code to replace all occurrences of 'N/A' with NaN in the DataFrame df.
df = df.replace([1], np.nan)We use replace to change all 'N/A' strings to np.nan, which pandas recognizes as missing values.
Complete the code to drop rows from df that contain any NaN values.
df_clean = df.[1](axis=0)
The dropna method removes rows or columns with missing values. Here, axis=0 means rows.
Fix the error in the code to convert the 'age' column to numeric, coercing errors to NaN.
df['age'] = pd.to_numeric(df['age'], errors=[1])
The errors='coerce' argument converts invalid parsing to NaN instead of raising an error.
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] > 3}The dictionary comprehension maps each word to its length using len(word). The condition filters words with length greater than 3.
Fill all three blanks to create a dictionary comprehension that maps uppercase keys to values only if value is positive.
{ [1]: [2] for [3], v in data.items() if v > 0 }The comprehension uses k.upper() as keys, v as values, and iterates over k, v pairs from data.items(). It filters values greater than zero.