Skip to main content

Random Number Generator

Project description

Random Number Package


random number generator

This module implement random number from the specified distribution.

Real-valued distributions


The following functions generate specific real-valued distributions. Function parameters are named after the corresponding variables in the distribution’s equation.

  1. uniform(size)

    Return the 'size random floating point numbers in the range [0.0, 1.0).

  2. gaussian(size)

  3. binomial(trials,probability,size)

    return samples from a binomial distribution, where each sample is equal to the number of successes over the n trials.

  4. chisquare(df,size)

    return samples from a chi-square distribution. Parameters:
    a. df : int or array_like of ints;Number of degrees of freedom. b. size : int or tuple of ints, Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. If size is None (default), a single value is returned if df is a scalar. Otherwise, np.array(df).size samples are drawn.

  5. weibull(size) return samples from a Weibull distribution. Parameters: a : float or array_like of floats Shape of the distribution. Should be greater than zero. size : int or tuple of ints, optional Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. If size is None (default), a single value is returned if a is a scalar. Otherwise, np.array(a).size samples are drawn.

  6. exponential(scale,size) return samples from an exponential distribution. Parameters: scale : float or array_like of floats The scale parameter, \beta = 1/\lambda. size : int or tuple of ints, optional Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. If size is None (default), a single value is returned if scale is a scalar. Otherwise, np.array(scale).size samples are drawn.

  7. poisson(lam,size) return samples from a poisson distribution. Parameters: lam : float or array_like of floats Expectation of interval, should be >= 0. A sequence of expectation intervals must be broadcastable over the requested size. size : int or tuple of ints, optional Output shape. If the given shape is, e.g., (m, n, k), then m * n * k samples are drawn. If size is None (default), a single value is returned if lam is a scalar. Otherwise, np.array(lam).size samples are drawn.

Project details


Release history Release notifications | RSS feed

This version

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rand_number__gen-0.1.tar.gz (3.3 kB view hashes)

Uploaded Source

Built Distribution

rand_number_gen-0.1-py3-none-any.whl (4.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page