Get a sample of this DistributedDataFrame and return a new DistributedDataFrame :param fraction: fraction to take sample, has to be in the (0, 1] range :param replacement: sample with or without replacement :param seed: random seed :return: a new Distributed
(self, fraction, replacement=False, seed=123)
| 71 | return self._jddf.getViewHandler().getRandomSample(size, replacement, seed) |
| 72 | |
| 73 | def sample2ddf(self, fraction, replacement=False, seed=123): |
| 74 | """ |
| 75 | Get a sample of this DistributedDataFrame and return a new DistributedDataFrame |
| 76 | |
| 77 | :param fraction: fraction to take sample, has to be in the (0, 1] range |
| 78 | :param replacement: sample with or without replacement |
| 79 | :param seed: random seed |
| 80 | :return: a new DistributedDataFrame |
| 81 | """ |
| 82 | if fraction <= 0 or fraction > 1: |
| 83 | raise ValueError('fraction: expected a number in the (0, 1] range') |
| 84 | |
| 85 | return DistributedDataFrame(self._jddf.getViewHandler().getRandomSample(fraction, replacement, seed)) |
| 86 | |
| 87 | def summary(self): |
| 88 | """ |
nothing calls this directly
no test coverage detected