コード例 #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), 0)
    elif not x and not y:
        return _cmps.nonZero(condition)
    else:
        raise ValueError, "Both x and y must be specified"
コード例 #2
0
ファイル: jycomparisons.py プロジェクト: REJN2/scisoft-core
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"
コード例 #3
0
def select(condlist, choicelist, default=0):
    '''Return dataset with items drawn from choices according to conditions'''
    return _dsutils.select(condlist, choicelist, default)
コード例 #4
0
ファイル: jycore.py プロジェクト: flucke/scisoft-core
def select(condlist, choicelist, default=0):
    '''Return dataset with items drawn from choices according to conditions'''
    return _dsutils.select(condlist, choicelist, default)