'Create a new distribution using the given histogram
Parameters
histogram : tuple of array_like
Tuple containing two array_like objects
The first containing the content of n bins
The second containing the (n+1) bin boundaries
In particular the return value np.histogram is accepted'

def __init__(self, histogram, *args, **kwargs):

    self._histogram = histogram
    if (len(histogram) != 2):
        raise ValueError('Expected    length    2    for    parameter    histogram')
    self._hpdf = np.asarray(histogram[0])
    self._hbins = np.asarray(histogram[1])
    if ((len(self._hpdf) + 1) != len(self._hbins)):
        raise ValueError('Number    of    elements    in    histogram    content    and    histogram    boundaries    do    not    match,    expected    n    and    n+1.')
    self._hbin_widths = (self._hbins[1:] - self._hbins[:(-1)])
    self._hpdf = (self._hpdf / float(np.sum((self._hpdf * self._hbin_widths))))
    self._hcdf = np.cumsum((self._hpdf * self._hbin_widths))
    self._hpdf = np.hstack([0.0, self._hpdf, 0.0])
    self._hcdf = np.hstack([0.0, self._hcdf])
    kwargs['a'] = self._hbins[0]
    kwargs['b'] = self._hbins[(-1)]
    super(rv_histogram, self).__init__(*args, **kwargs)
