I was wondering how to generate a random weibull distribution with 2-parameter (lambda, k) in python. I know that numpy has a numpy.random.weibull, but it only accepts the a parameter as the shape of the distribution.
相关问题
- how to define constructor for Python's new Nam
- streaming md5sum of contents of a large remote tar
- How to get the background from multiple images by
- Evil ctypes hack in python
- Correctly parse PDF paragraphs with Python
Well, if you sample a number from weibull distribution with scale parameter missing (which assumes scale is equal to 1), then to get it scale multiply by lambda.
Severin Pappadeux's answer is probably the simplest way to include the scale parameter. An alternative is to use
scipy.stats.weibull_min
.weibull_min
has three parameters: shape, location and scale. You only want the shape and scale, so you would set the location to 0.