Exemple #1
0
def histogram(a, bins=10, range=None, normed=False, weights=None, new=None): #@ReservedAssignment
    '''Histogram of input'''
    if normed or weights or new:
        raise ValueError, 'Option not supported yet'

    h = None
    if range is None:
        h = _histo(bins)
    elif len(range) != 2:
        raise ValueError, 'Need two values in range'
    else:
        h = _histo(bins, range[0], range[1])

    from jycore import asDatasetList as _asList
    return h.value(_asList(a))
Exemple #2
0
def histogram(a,
              bins=10,
              range=None,
              normed=False,
              weights=None,
              density=None):  #@ReservedAssignment
    '''Histogram of input'''
    if normed or density:
        raise ValueError("Option not supported yet")

    if isinstance(bins, str):
        raise ValueError("bin string option not supported yet")

    if not isinstance(bins, int):
        bins = _asarray(bins)._jdataset()
    h = _histo(bins)

    if range is not None:
        if len(range) != 2:
            raise ValueError("Need two values in range")
        h.setMinMax(range[0], range[1])

    if weights is not None:
        h.setWeights(_asarray(weights)._jdataset())

    if not isinstance(a, _ds):
        a = _asarray(a)._jdataset()
    return h.value(a)
Exemple #3
0
def histogram(a,
              bins=10,
              range=None,
              normed=False,
              weights=None,
              new=None):  #@ReservedAssignment
    '''Histogram of input'''
    if normed or weights or new:
        raise ValueError, "Option not supported yet"

    h = None
    if range is None:
        h = _histo(bins)
    elif len(range) != 2:
        raise ValueError, "Need two values in range"
    else:
        h = _histo(bins, range[0], range[1])

    from jycore import asDatasetList as _asList
    return h.value(_asList(a))
Exemple #4
0
def histogram(a, bins=10, range=None, normed=False, weights=None, density=None): #@ReservedAssignment
    '''Histogram of input'''
    if normed or weights or density:
        raise ValueError, "Option not supported yet"

    if isinstance(bins, str):
        raise ValueError, "bin string option not supported yet"

    h = None
    if range is None:
        if not isinstance(bins, int):
            bins = _asarray(bins)._jdataset()
        h = _histo(bins)
    elif len(range) != 2:
        raise ValueError, "Need two values in range"
    else:
        h = _histo(bins, range[0], range[1])

    if not isinstance(a, _ds):
        a = _asarray(a)._jdataset()
    return h.value(a)