The bootstrap is a resampling method that draws, with replacement, many samples of the same size as the observed data to estimate the distribution of a statistic. The 2.5th and 97.5th percentiles of this distribution give a 95% confidence interval. It applies to statistics with no simple formula, such as the median.
Example
moyennes = [rng.choice(x, size=len(x), replace=True).mean() for _ in range(5000)]
ic = np.percentile(moyennes, [2.5, 97.5])