Complete the code to select rows where the 'color' column values are in the list ['red', 'blue'].
filtered = df[df['color'].[1](['red', 'blue'])]
The isin() method checks if each element in the 'color' column is in the given list.
Complete the code to filter rows where the 'age' column values are in the list [25, 30, 35].
result = data[data['age'].[1]([25, 30, 35])]
The isin() method is used to filter rows where 'age' matches any value in the list.
Fix the error in the code to correctly filter rows where 'status' is either 'active' or 'pending'.
filtered_data = df[df['status'].[1](['active', 'pending'])]
The isin() method correctly checks if 'status' values are in the given list.
Fill both blanks to create a dictionary comprehension that maps words to their lengths only if the 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), and 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 lengths only if the length is greater than 4.
{ [1]: [2] for word in words if [3] }The dictionary comprehension uses word.upper() as keys, maps to len(word) as values, and filters words with length greater than 4 using len(word) > 4.