I've this issue, I don't know maybe I'm getting tired, I've this dataframe
tostack=pd.DataFrame([['tol', 0.001],
       ['solver', 'svd'],
       ['alpha', 0.001],
       ['tol', 0.01],
       ['solver', 'cholesky'],
       ['alpha', 0.001],
       ['tol', 1.0],
       ['solver', 'svd'],
       ['alpha', 1.0]], columns=["param_name",'param_set'])
I need to "pivot" this into this shape :
tol      solver      alpha
0.001      'svd'     0.01
0.01    'cholesky'   0.001
1          'svd'     1.0
I've tried to pivot but I get "nan" between rows with following code
pd.DataFrame(dic_loc, columns=["param_name",'param_set'])\
    .pivot( columns='param_name', values='param_set')
So, what I need it's to iterate over the items and append the values by row, for each 3 values.
Any ideas are welcome,
 
    