I've ran a bayesian model using pymc
and drew a sample of 1,000 values across six chains for 1774 observations. This resulted in an array with shape (6, 1000, 1774)
. I need the mean sampled value for each 1774
observations. So in essenace, the mean of each chain, and each 1000 samples for each 1774 observations.
if x = array (6,1000,1774)
.
I need to add the mean values to my dataframe with a length of 1774 as another column.
Using fake data,
import numpy as np
x = np.random.rand(6,1000,1774)
Running:
x.mean(axis = 0) gives shape(1000, 1774)
How do I do this correctly?