I have the following df from a vendor:
Unnamed: 0 Unnamed: 1 Unnamed: 2 agg metrics 10/20/22 10/20/22 10/21/22 10/21/22 title content title season episode start hours start hours book blue 1 3 2 2 5 2 movie orange 2 4 11 4 7 4 I need the output like this:
title content title season episode date start hours book blue 1 3 10/20/22 2 2 book blue 1 3 10/21/22 5 2 movie orange 2 4 10/20/22 11 4 movie orange 2 4 10/21/22 7 4 df = pd.read_csv('file') df = df.drop(labels=0, axis=0) df1 = df.melt(['Unnamed: 0','Unnamed: 1', 'Unnamed: 2', 'agg metrics'],var_name='Date', value_name='Value') but this doesn't return the proper output. apologies for not knowing how to represent this properly. hopefully my IP/OP helps.
Essentially, i'm having trouble transposing multiple headers.
Thanks for your help!