Ejemplo n.º 1
0
def where(condition, x=None, y=None):
    '''Return items from x or y depending on condition'''
    if x and y:
        return _dsutils.select(condition, x, y)
    elif not x and not y:
        return _cmps.nonZero(condition)
    else:
        raise ValueError, "Both x and y must be specified"
Ejemplo n.º 2
0
def where(condition, x=None, y=None):
    '''Return items from x or y depending on condition'''
    if x and y:
        return _dsutils.select(condition, x, y)
    elif not x and not y:
        return _cmps.nonZero(condition)
    else:
        raise ValueError, "Both x and y must be specified"
Ejemplo n.º 3
0
def nonzero(a):
    '''Return the indices for items that are non-zero'''
    return _cmps.nonZero(a)
Ejemplo n.º 4
0
def nonzero(a):
    '''Return the indices for items that are non-zero'''
    return _cmps.nonZero(a)