def histogram(data, *args, **kwargs):
    """
    Create and fill a one-dimensional histogram.

    The same arguments as the ``Hist`` class are expected.
    If the number of bins and the ranges are not specified they are
    automatically deduced with the ``autobinning`` function using the method
    specified by the ``binning`` argument. Only one-dimensional histogramming
    is supported.
    """
    from .autobinning import autobinning
    dim = kwargs.pop('dim', 1)
    if dim != 1:
        raise NotImplementedError
    if 'binning' in kwargs:
        args = autobinning(data, kwargs['binning'])
        del kwargs['binning']
    histo = Hist(*args, **kwargs)
    for d in data:
        histo.Fill(d)
    return list(histo.xedgesl()), histo
def histogram ( data , * args , ** kwargs ) : from . autobinning import autobinning dim = kwargs . pop ( 'dim' , 1 ) if dim != 1 : raise NotImplementedError if 'binning' in kwargs : args = autobinning ( data , kwargs [ 'binning' ] ) del kwargs [ 'binning' ] histo = Hist ( * args , ** kwargs ) for d in data : histo . Fill ( d ) return list ( histo . xedgesl ( ) ) , histo
Create and fill a one-dimensional histogram.

    The same arguments as the ``Hist`` class are expected.
    If the number of bins and the ranges are not specified they are
    automatically deduced with the ``autobinning`` function using the method
    specified by the ``binning`` argument. Only one-dimensional histogramming
    is supported.