My question is a bit linked to this one, except that I want to turn my lists into rows not columns, and specify the names of the columns.
For example, I start with a dictionary:
my_dict = {'label1' : [0.1, 1.1, 32.1] , 'label2' : [12.3, 5.3, 2.4], 'label3' : [1.5, 7.5, 7.4]}
I want to be able to specify column names like:
cols = ['labels','val1' ,'val2, 'val3']
and create the dataframe
labels  | val1  | val2  | val3
label1    0.1     1.1     32.1
label2    12.3    5.3     2.4
label3    1.5     7.5     7.4
 
     
    