choice#
- scikitplot.random.choice(self, a, size=None, replace=True, p=None)#
Random sample from array.
- Parameters:
- aint or array_like
If int, random sample from np.arange(a)
- sizeint or tuple, optional
Output shape
- replacebool, default=True
Whether to sample with replacement
- parray_like, optional
Probabilities for each element
- Returns:
- scalar or ndarray
Random samples
Examples
>>> gen = KissGenerator(42) >>> gen.choice(10, size=5) array([...])