I have a dictionary with string as keys and arrays as values, like this:
dic = {'x': array([[10],
[27],
[12],
[132]]), 'y': array([[-39],
[23],
[42],
[98]]), 'z': array([[-100],
[-123],
[92],
[88.2]])}
How could i convert it to a pandas dataframe in the following format:
iter x y z
0 10 -39 -100
1 27 23 -123
2 12 42 92
3 132 98 88.2
Tried the following:
df = pd.DataFrame.from_dict(dic)
Getting the following error:
ValueError: Per-column arrays must each be 1-dimensional
dic = {'x': [10, 27, 12, 132], 'y': [-39, 23, 42, 98], 'z': [-100, -123, 92, 88.2]}