sample = wei.rvs(1000)
shape, loc, scale = s.weibull_min.fit(sample, floc=0)
x = np.linspace(np.min(sample), np.max(sample))
dx = x[1] - x[0]
deriv = np.diff(wei.cdf(x)) / dx
plt.hist(sample, normed=True, fc='none', ec='grey', label='frequency')
plt.plot(x, wei.cdf(x), label='cdf')
plt.plot(x, wei.pdf(x), label='pdf')
plt.plot(x[1:] - dx / 2, deriv, label='derivative')
plt.legend(loc=1)
plt.show()
Calculating the derivative of cumulative density function in Python