Exemplo n.º 1
0
def cumsum(a, axis=None, dtype=None):
    '''Cumulative sum of input'''
    dtype = _translatenativetype(dtype)
    if dtype is not None:
        a = a.cast(_translatenativetype(dtype).value)
    if axis is None:
        return _stats.cumulativeSum(a)
    else:
        return _stats.cumulativeSum(a, _jint(axis))
Exemplo n.º 2
0
def cumsum(a, axis=None, dtype=None):
    '''Cumulative sum of input'''
    dtype = _translatenativetype(dtype)
    if dtype is not None:
        a = a.cast(_translatenativetype(dtype).value)
    if axis is None:
        return _stats.cumulativeSum(a)
    else:
        return _stats.cumulativeSum(a, _jint(axis))
Exemplo n.º 3
0
def prod(a, axis=None, dtype=None, keepdims=False):
    '''Product of input'''
    if dtype is None:
        if axis is None:
            return a.product(_empty_boolean_array)
        elif isinstance(axis, int):
            return a.product(_jint(axis))
        elif isinstance(axis, tuple):
            return a.product([_jint(x) for x in axis])
    dtval = _translatenativetype(dtype).value
    if axis is None:
        return _stats.typedProduct(a, dtval)
    return _stats.typedProduct(a, dtval, axis)
Exemplo n.º 4
0
def prod(a, axis=None, dtype=None, keepdims=False):
    '''Product of input'''
    if dtype is None:
        if axis is None:
            return a.product(_empty_boolean_array)
        elif isinstance(axis, int):
            return a.product(_jint(axis))
        elif isinstance(axis, tuple):
            return a.product([_jint(x) for x in axis])
    dtval = _translatenativetype(dtype).value
    if axis is None:
        return _stats.typedProduct(a, dtval)
    return _stats.typedProduct(a, dtval, axis)
Exemplo n.º 5
0
def quantile(a, q, axis=None):
    '''Quantile (or inverse cumulative distribution) function based on input

    a -- data
    q -- probability value(s)
    axis -- can be None'''
    q = _toList(q)
    if axis is None:
        if len(q) == 1:
            return _stats.quantile(a, q)[0]
        return _stats.quantile(a, q)
    else:
        if len(q) == 1:
            return _stats.quantile(a, axis, q)[0]
        return _stats.quantile(a, axis, q)
Exemplo n.º 6
0
def quantile(a, q, axis=None):
    '''Quantile (or inverse cumulative distribution) function based on input

    a -- data
    q -- probability value(s)
    axis -- can be None'''
    q = _toList(q)
    if axis is None:
        if len(q) == 1:
            return _stats.quantile(a, q)[0]
        return _stats.quantile(a, q)
    else:
        if len(q) == 1:
            return _stats.quantile(a, axis, q)[0]
        return _stats.quantile(a, axis, q)
Exemplo n.º 7
0
def skewness(a, axis=None):
    '''Skewness of input'''
    if axis is None:
        return _stats.skewness(a)
    else:
        return _stats.skewness(a, axis)
Exemplo n.º 8
0
def residual(a, b, weight=None):
    '''Residual (sum of squared difference) of two inputs with optional weighting'''
    if weight is None:
        return _stats.residual(a, b)
    return _stats.weightedResidual(a, b, weight)
Exemplo n.º 9
0
def iqr(a, axis=None):
    '''Interquartile range of input'''
    if axis is None:
        return _stats.iqr(a)
    else:
        return _stats.iqr(a, axis)
Exemplo n.º 10
0
def kurtosis(a, axis=None):
    '''Kurtosis of input'''
    if axis is None:
        return _stats.kurtosis(a)
    else:
        return _stats.kurtosis(a, axis)
Exemplo n.º 11
0
def cumprod(a, axis=None):
    '''Cumulative product of input'''
    if axis is None:
        return _stats.cumulativeProduct(a)
    else:
        return _stats.cumulativeProduct(a, axis)
Exemplo n.º 12
0
def median(a, axis=None):
    '''Median of input'''
    if axis is None:
        return _stats.median(a)
    else:
        return _stats.median(a, axis)
Exemplo n.º 13
0
def median(a, axis=None, keepdims=False):
    '''Median of input'''
    if axis is None:
        return _stats.median(a)
    else:
        return _stats.median(a, axis)
Exemplo n.º 14
0
def cumsum(a, axis=None):
    '''Cumulative sum of input'''
    if axis is None:
        return _stats.cumulativeSum(a)
    else:
        return _stats.cumulativeSum(a, axis)
Exemplo n.º 15
0
def cumprod(a, axis=None):
    '''Cumulative product of input'''
    if axis is None:
        return _stats.cumulativeProduct(a)
    else:
        return _stats.cumulativeProduct(a, axis)
Exemplo n.º 16
0
def kurtosis(a, axis=None):
    '''Kurtosis of input'''
    if axis is None:
        return _stats.kurtosis(a)
    else:
        return _stats.kurtosis(a, axis)
Exemplo n.º 17
0
def iqr(a, axis=None):
    '''Interquartile range of input'''
    if axis is None:
        return _stats.iqr(a)
    else:
        return _stats.iqr(a, axis)
Exemplo n.º 18
0
def cumsum(a, axis=None):
    '''Cumulative sum of input'''
    if axis is None:
        return _stats.cumulativeSum(a)
    else:
        return _stats.cumulativeSum(a, axis)
Exemplo n.º 19
0
def residual(a, b, weight=None):
    '''Residual (sum of squared difference) of two inputs with optional weighting'''
    if weight is None:
        return _stats.residual(a, b)
    return _stats.weightedResidual(a, b, weight)
Exemplo n.º 20
0
def skewness(a, axis=None):
    '''Skewness of input'''
    if axis is None:
        return _stats.skewness(a)
    else:
        return _stats.skewness(a, axis)