0

I need the columns of a dataframe to be decreased since for each index there are differentr values and each value is taking a new column. For example.

I have below dataframe

    0   1   2   3
    -----------------------
a   1   2   3   4

b   x   y   z   p

c   s1  l2  n3  m4

d   @   $   *   #

I need this in the form

name    value
----------------------
a   1
    
b   x
    
c   s1
    
d   @
    
a   2
    
b   y
    
c   z
    
d   $
    
a   3
    
b   z
    
c   n3
    
d   *
    
a   4
    
b   p
    
c   m4
    
d   #

I tried transposing the dataframe, but I didn't get required result.

0 Answers0