✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
What will be the output of the following code?
import pandas as pd
data = {'Category': ['A', 'A', 'B', 'B', 'C'], 'Value': [5, 15, 25, 35, 45], 'Score': [2, 4, 6, 8, 10]}
df = pd.DataFrame(data)
result = df.groupby('Category').agg({'Value': 'sum', 'Score': 'mean'})
print(result)
Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!