truncated normal distribution with scipy in python
Here's the procedure to follow according to the documentation of truncnorm
.
# user inputmyclip_a = 0myclip_b = 1my_mean = 0.5my_std = 0.3a, b = (myclip_a - my_mean) / my_std, (myclip_b - my_mean) / my_stdx_range = np.linspace(-1,2,1000)plt.plot(x_range, truncnorm.pdf(x_range, a, b, loc = my_mean, scale = my_std))