Home | History | Annotate | Download | only in python2.7

Lines Matching full:population

267                 "enough bits to choose from a population range this large")
290 def sample(self, population, k):
291 """Chooses k unique random elements from a population sequence.
293 Returns a new list containing elements from the population while
294 leaving the original population unchanged. The resulting list is
299 Members of the population need not be hashable or unique. If the
300 population contains repeats, then each occurrence is a possible
305 large population: sample(xrange(10000000), 60)
312 # population, then tracking selections is efficient, requiring
318 n = len(population)
320 raise ValueError("sample larger than population")
327 if n <= setsize or hasattr(population, "keys"):
330 pool = list(population)
344 result[i] = population[j]
346 if isinstance(population, list):
348 return self.sample(tuple(population), k)