Complete the code to group the DataFrame by the 'team' column.
grouped = df.[1]('team')
The groupby method splits the DataFrame into groups based on the values in the specified column.
Complete the code to calculate the mean score for each group.
mean_scores = grouped['score'].[1]()
The mean method calculates the average value for each group.
Fix the error in the code to apply a custom function to each group.
result = grouped['score'].[1](lambda x: x.max() - x.min())
The apply method lets you run a custom function on each group.
Fill both blanks to create a dictionary of word lengths for words longer than 3 characters.
lengths = {word: [1] for word in words if [2]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 of uppercase keys and values filtered by positive values.
result = [1]: [2] for k, v in data.items() if v [3] 0}
This dictionary comprehension creates keys as uppercase strings and keeps values only if they are positive.