logo

Crowdly

What will be the output of the following code? import pandas as pd data = {'Ca...

✅ 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)

100%
0%
0%
0%
More questions like this

Want instant access to all verified answers on learning.monash.edu?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!