Bootstrapping — is random sampling to estimate the standard deviation, or 95th confidence interval (or some other interval).
Monte Carlo — is estimating the probability of an event.
If one wants to get the mean of randomly sampling, I don’t think that is either monte carlo OR bootstrapping?
## Here is the code to get the mean and std of n random cores from 100 core samples.
sample_number = 3
# choose n random samples from the group
df_3_random = df.groupby(‘CEA_strata’).apply(lambda x: x.sample(sample_number)).reset_index(drop=True)
sample_number = str(sample_number)
print(df_3_random.groupby([‘CEA’,’separate_strata_name’])[‘cumulative_whole_carbon_mass’].count().reset_index().round(2) )# this will be count)
df_3_random.groupby([‘CEA’,’separate_strata_name’]).agg(mean_carbon=(‘cumulative_whole_carbon_mass’,np.mean), std_carbon=(‘cumulative_whole_carbon_mass’,np.std)).reset_index()