Complete the code to apply a lambda function that doubles each value in the 'score' column.
df['double_score'] = df['score'].[1](lambda x: x * 2)
The apply() method lets you run a function on each element of a pandas Series. Here, it doubles each score.
Complete the code to create a new column 'passed' that is True if 'score' is 50 or more, else False.
df['passed'] = df['score'].apply(lambda x: x [1] 50)
The lambda checks if each score is greater than or equal to 50 to mark passing.
Fix the error in the lambda function to correctly add 10 to each value in 'score'.
df['score_plus_10'] = df['score'].apply(lambda x: x [1] 10)
The lambda should add 10 to each score, so the plus sign '+' is correct.
Fill both blanks to create a dictionary of word lengths for words longer than 3 characters.
lengths = {word: [1] for word in words if len(word) [2] 3}The dictionary comprehension maps each word to its length if the word length is greater than 3.
Fill all three blanks to create a dictionary with uppercase keys and values greater than 0.
result = [1]: [2] for k, v in data.items() if v [3] 0}
The dictionary comprehension uses uppercase keys, keeps values, and filters for values greater than zero.