We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 24f89b7 commit 0bd637aCopy full SHA for 0bd637a
datastream/samplers/sequential_sampler.py
@@ -23,5 +23,7 @@ def __iter__(self):
23
return iter(self.sampler)
24
25
def sample_proportion(self, proportion):
26
- sampler = SequentialSampler(int(len(self) * proportion))
27
- return sampler
+ return SequentialSampler(min(
+ len(self),
28
+ int(len(self) * proportion)
29
+ ))
0 commit comments