Transpose pandas dataframe
Question: How do I convert a list of lists to a panda dataframe?

it is not in the form of coloumns but instead in the form of rows.

    
    
    #!/usr/bin/env python
    
    from random import randrange
    import pandas
    
    data = [[[randrange(0,100) for j in range(0, 12)] for y in range(0, 12)] for x in range(0, 5)]
    print data
    df = pandas.DataFrame(data[0], columns=['B','P','F','I','FP','BP','2','M','3','1','I','L'])
    print df
    

for example:

    
    
    data[0][0] == [64, 73, 76, 64, 61, 32, 36, 94, 81, 49, 94, 48]
    

I want it to be shown as rows and not coloumns.

currently it shows somethign like this

    
    
         B   P   F   I  FP  BP   2   M   3   1   I   L
    0   64  73  76  64  61  32  36  94  81  49  94  48
    1   57  58  69  46  34  66  15  24  20  49  25  98
    2   99  61  73  69  21  33  78  31  16  11  77  71
    3   41   1  55  34  97  64  98   9  42  77  95  41
    4   36  50  54  27  74   0   8  59  27  54   6  90
    5   74  72  75  30  62  42  90  26  13  49  74   9
    6   41  92  11  38  24  48  34  74  50  10  42   9
    7   77   9  77  63  23   5  50  66  49   5  66  98
    8   90  66  97  16  39  55  38   4  33  52  64   5
    9   18  14  62  87  54  38  29  10  66  18  15  86
    10  60  89  57  28  18  68  11  29  94  34  37  59
    11  78  67  93  18  14  28  64  11  77  79  94  66
    

I want the rows and coloumns to be switched. Moreover, How do I make it for
all 5 main lists?

This is how I want the output to look like with other coloumns also filled in.

    
    
         B   P   F   I  FP  BP   2   M   3   1   I   L
    0    64 
    1    73  
    1    76  
    2    64  
    3    61  
    4    32  
    5    36  
    6    94  
    7    81  
    8    49  
    9    94  
    10   48
    

However. `df.transpose()` won't help.


Answer: 
    import numpy
    
    
    df = pandas.DataFrame(numpy.asarray(data[x]).T.tolist(), columns=['B','P','F','I','FP','BP','2','M','3','1','I','L'])
    

