Using bootstrapping random.choice
<p>I am trying to use bootstrapping to make 1000 replications of the sons (np.random.choice) for resampling with replacement, so that i can calculate the mean for each replication. Then I would compare the standard deviation of these mean values ​​with standard.</p>
<p>However I don't get bootstrapping part right, how to fix that?</p>
<pre><code>import numpy as np
import pandas as pd
from matplotlib import pyplot as plt
import seaborn as sns
from scipy import stats

df = pd.read_csv('http://www.math.uah.edu/stat/data/Pearson.txt',
                 delim_whitespace=True)
df.head()
y = df['Son'].values

Replications = np.random.choice(y, 1000, replace = True)
print(&quot;Replications: &quot; , Replications)
print(&quot;&quot;)
Mean = np.mean(Replications)

print(&quot;Mean: &quot; , Mean)

sem = stats.sem(y)
print (&quot;The SEM : &quot;, sem)
</code></pre>