Lines Matching refs:population
142 .. function:: choices(population, weights=None, *, cum_weights=None, k=1)
144 Return a *k* sized list of elements chosen from the *population* with replacement.
145 If the *population* is empty, raises :exc:`IndexError`.
158 the same length as the *population* sequence. It is a :exc:`TypeError`
185 .. function:: sample(population, k)
187 Return a *k* length list of unique elements chosen from the population sequence
190 Returns a new list containing elements from the population while leaving the
191 original population unchanged. The resulting list is in selection order so that
196 Members of the population need not be :term:`hashable` or unique. If the population
201 population: ``sample(range(10000000), k=60)``.
203 If the sample size is larger than the population size, a :exc:`ValueError`