Pandas > Melt columns

Name
Code
Output
dataframe = pandas.DataFrame(numpy.random.randint(0,100,size=(3, 2)), columns=['C1','C2'])
print ("dataframe")
print (dataframe)
dataframe2 = dataframe.melt()
print ("melted dataframe")
print (dataframe2)
dataframe
   C1  C2
0  83  62
1  18  20
2  78  94
melted dataframe
  variable  value
0       C1     83
1       C1     18
2       C1     78
3       C2     62
4       C2     20
5       C2     94