I have a dataframe of lists, each value in the list represents the mean, std, and number of values of a larger dataset. I would like to create a subindex for three values in that list.
An example dataframe is:
np.random.seed(2)
d={i: {j:[np.random.randint(10) for i in range(0,3)] for j in ['x','y','z']} for i in ['a','b','c']}
pd.DataFrame.from_dict(d,orient='index')
Which gives:
x y z
a [1, 4, 5] [7, 4, 4] [0, 6, 3]
b [7, 1, 9] [1, 3, 8] [3, 6, 2]
c [1, 6, 6] [6, 5, 0] [6, 5, 9]
I would like:
x y z
mean std count mean std count mean std count
a 1 4 5 7 4 4 0 6 3
b 7 1 9 1 3 8 3 6 2
c 1 6 6 6 5 0 6 5 9