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'],

              'Subcategory': ['X', 'Y', 'X', 'Y', 'X'],

              'Value': [10, 20, 30, 40, 50]}

df = pd.DataFrame(data)

result = df.pivot(index='Category', columns='Subcategory', values='Value')

print(result)

0%
0%
100%
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!