def poisson(lam=1.0, size=None): '''Return dataset of given shape (or a single number) with samples taken from a Poisson distribution of parameter lam ''' if size is None: return _random.poisson(lam, [1]).getObject([0]) return _random.poisson(lam, _asiter(size))
def exponential(scale=1.0, size=None): '''Return dataset of given shape (or a single number) with samples taken from an exponential distribution of parameter scale ''' if size is None: return _random.exponential(scale, [1]).getObject([0]) return _random.exponential(scale, _asiter(size))
def random_integers(low, high=None, size=None): '''Return dataset of given shape (or a single number) with samples taken from a discrete distribution of integers in the range [low, high] ''' if high is None: high = low low = 0 if size is None: return _random.random_integers(low, high, [1]).getObject([0]) return _random.random_integers(low, high, _asiter(size))