Модули метода random betavariate, sample, Random, normalvariate, gammavariate

Слайд 2

BETAVARIATE

Beta distribution.
Conditions on the parameters are alpha > 0 and beta

BETAVARIATE Beta distribution. Conditions on the parameters are alpha > 0 and
> 0.
Returned values range between 0 and 1.

Слайд 3

SAMPLE

Chooses k unique random elements from a population sequence or set.
Returns

SAMPLE Chooses k unique random elements from a population sequence or set.
a new list containing elements from the population while
leaving the original population unchanged. The resulting list is
in selection order so that all sub-slices will also be valid random
samples. This allows raffle winners (the sample) to be partitioned
into grand prize and second place winners (the subslices).
Members of the population need not be hashable or unique. If the
population contains repeats, then each occurrence is a possible
selection in the sample.
To choose a sample in a range of integers, use range as an argument.
This is especially fast and space efficient for sampling from a
large population: sample(range(10000000), 60)

Слайд 4

RANDOM

Random number generator base class used by bound module functions.
Used to

RANDOM Random number generator base class used by bound module functions. Used
instantiate instances of Random to get generators that don't
share state.
Class Random can also be subclassed if you want to use a different basic
generator of your own devising: in that case, override the following
methods: random(), seed(), getstate(), and setstate().
Optionally, implement a getrandbits() method so that randrange()
can cover arbitrarily large ranges.

Слайд 5

NORMALVARIATE

Normal distribution.
mu is the mean, and sigma is the standard deviation.

NORMALVARIATE Normal distribution. mu is the mean, and sigma is the standard deviation.
Имя файла: Модули-метода-random-betavariate,-sample,-Random,-normalvariate,-gammavariate.pptx
Количество просмотров: 20
Количество скачиваний: 0