How to transpose values in one column to columns using Pandas?

  pandas, python

Hi there I have a data set look like df1 below and I want to make it look like df2 using pandas. I have tried to use pivot and transpose but can’t wrap my head around how to do it. Appreciate any help!

df1

df2

Source: Python Questions

LEAVE A COMMENT