Esempio 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"
Esempio 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"
Esempio n. 3
0
def nonzero(a):
    '''Return the indices for items that are non-zero'''
    return _cmps.nonZero(a)
Esempio n. 4
0
def nonzero(a):
    '''Return the indices for items that are non-zero'''
    return _cmps.nonZero(a)