Complete the code to select rows where the 'age' column is greater than 30.
filtered = df[df['age'] [1] 30]
We use the greater than operator > to select rows where 'age' is more than 30.
Complete the code to select rows where 'age' is greater than 30 and 'score' is at least 80.
filtered = df[(df['age'] > 30) [1] (df['score'] >= 80)]
Use & to combine conditions with 'and' in pandas.
Fix the error in the code to select rows where 'age' is less than 25 or 'score' is greater than 90.
filtered = df[(df['age'] [1] 25) | (df['score'] > 90)]
The condition should check if 'age' is less than 25 using <.
Fill both blanks to create a dictionary of words and their lengths for words longer than 4 characters.
lengths = {word: [1] for word in words if len(word) [2] 4}The dictionary maps each word to its length using len(word). The condition keeps words longer than 4 characters using >.
Fill all three blanks to create a dictionary with uppercase words as keys and their scores for scores above 50.
result = { [1]: [2] for word, score in data.items() if score [3] 50 }word.lower() for keys instead of uppercase.Keys are uppercase words using word.upper(). Values are scores. The condition selects scores greater than 50.