Reservoir Samplingjeremykun.com2 pointstimnic13 years agoPython snippet to sample from a (finite) stream of unknown size at random.