import numpy as np
import matplotlib.pyplot as plt
from scipy.stats import norm
Session Details
- Date: [Day of week], [Month] [Day], [Year]
- Time: [Start time]–[End time] ([morning/afternoon/evening] session)
- Location: [Venue or virtual platform]
- Instructor: [Instructor Name]
Embedding Python code into the website
Loading packages
Code chunks
# Parameters of the normal distribution
= 0 # mean
mu = 1 # standard deviation
sigma = 1000
n_samples
# Sample from the distribution
= np.random.normal(mu, sigma, n_samples)
samples
# Plot the true PDF
= np.linspace(mu - 4*sigma, mu + 4*sigma, 1000)
x = norm.pdf(x, mu, sigma) pdf
Cross reference figures
You can add special tags to be able to create links to figures. See Figure 1 for details.
Code
# Plot histogram of samples
=30, density=True, alpha=0.6, color="skyblue", label="Samples")
plt.hist(samples, bins
"r-", lw=2, label="True PDF")
plt.plot(x, pdf,
"Normal Distribution Sampling")
plt.title("Value")
plt.xlabel("Density")
plt.ylabel(
plt.legend() plt.show()
