Histogram.sample (function)
def sample(self, size=None, unit=None, as_quantity=False, wrap_at=None, seed=None, cache_sample=True)
Sample from the distribution.
See also:
Arguments
size(int or tuple or None, optional, default=None): size/shape of the resulting array.unit(astropy.unit, optional, default=None): unit to convert the resulting sample(s). Astropy must be installed in order to convert units.as_quantity(bool, optional, default=False): whether to return an astropy quantity object instead of just the value. Astropy must be installed.wrap_at(float, None, or False, optional, default=None): value to use for wrapping. See Histogram.wrap. If not provided or None, will use the value from Histogram.wrap_at. Note: wrapping is computed before changing units, sowrap_atmust be provided according to Histogram.unit notunit.seed(int, optional): seed to pass to np.random.seed prior to sampling.cache_sample(bool, optional, default=True): whether to override the existing Histogram.cached_sample.
Returns
- float or array: float if
size=None, otherwise a numpy array with shape defined bysize.