Complete the code to group the DataFrame by the 'Category' column.
grouped = df.[1]('Category')
The groupby() function groups data by the specified column.
Complete the code to calculate the mean of each group.
mean_values = df.groupby('Category').[1]()
The mean() function calculates the average for each group.
Fix the error in the code to get the size of each group.
group_sizes = df.groupby('Category').[1]
The size() method returns the number of rows in each group. It needs parentheses to call it.
Fill both blanks to create a dictionary with word lengths for words longer than 3 letters.
lengths = {word: [1] for word in words if len(word) [2] 3}The dictionary comprehension maps each word to its length if the word is longer than 3 letters.
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}
This dictionary comprehension creates keys as uppercase strings and includes only items where the value is greater than zero.