How can I use the pivot
function in Pandas to reshape data by specifying an index column, columns for pivoting, and values to populate the resulting DataFrame?
import pandas as pd df = pd.DataFrame({'Category': ['A', 'B', 'A', 'B'], 'Value': [1, 2, 3, 4], 'Type': ['X', 'Y', 'X', 'Y']})