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`
192 .. function:: sample(population, k)
194 Return a *k* length list of unique elements chosen from the population sequence
197 Returns a new list containing elements from the population while leaving the
198 original population unchanged. The resulting list is in selection order so that
203 Members of the population need not be :term:`hashable` or unique. If the population
208 population: ``sample(range(10000000), k=60)``.
210 If the sample size is larger than the population size, a :exc:`ValueError`