I'm trying to create a Pandas dataframe from a python nested dictionary that looks like this:
dictionary = {'user1' : {'a': np.array([1,2,3,4]),
'b': np.array([6,7,8,9])},
'user2' : {'a': np.array([2,3,4,5]),
'b': np.array([7,8,9,1])}}
I'd like the data frame to look like this:
a_w a_x a_y a_z b_w b_x b_y b_z
user1 1 2 3 4 6 7 8 9
user2 2 3 4 5 7 8 9 1
EDIT: (where w,x,y,z are markers that tell what the value in the array represent)
I've tried to modify the solution in these question: Nested dictionary to multiindex dataframe where dictionary keys are column labels
Construct pandas DataFrame from items in nested dictionary
but cannot get the correct form.
Any help would be great, thank you.