Skip to main content
`Ctrl`+`K`

# uniform

astropy.uncertainty.uniform(*, lower=None, upper=None, center=None, width=None, n_samples, cls=<class 'astropy.uncertainty.core.Distribution'>, **kwargs)

  Create a Uniform distribution from the lower and upper bounds.

  Note that this function requires keywords to be explicit, and requires either `lower`/`upper` or `center`/`width`.

  Parameters:
    lower numpy:array_like

      The lower edge of this distribution. If a `Quantity`, the distribution will have the same units as `lower`.

    upper `Quantity`

      The upper edge of this distribution. Must match shape and if a `Quantity` must have compatible units with `lower`.

    center numpy:array_like

      The center value of the distribution. Cannot be provided at the same time as `lower`/`upper`.

    width numpy:array_like

      The width of the distribution. Must have the same shape and compatible units with `center` (if any).

    n_samples `python:int`

      The number of Monte Carlo samples to use with this distribution

    cls class

      The class to use to create this distribution. Typically a `Distribution` subclass.

    Remaining keywords are passed into the constructor of the ``cls``
  Returns:
    distr `Distribution` or `object`

      The sampled uniform distribution. The type will be the same as the parameter `cls`.