nrm = stats.logistic.cdf(1) - stats.logistic.cdf(0)
xrng = np.arange(0, 1, 0.01)
yrng = stats.logistic.pdf(xrng) / nrm
plt.plot(xrng, yrng)
yr = rnd.rand(100000) * nrm + stats.logistic.cdf(0)
xr = stats.logistic.ppf(yr)
plt.hist(xr, normed=True)
plt.show()
Усечение случайных распределений SciPy