本文整理匯總了Python中uk.ac.diamond.scisoft.analysis.dataset.Comparisons類的典型用法代碼示例。如果您正苦於以下問題:Python Comparisons類的具體用法?Python Comparisons怎麽用?Python Comparisons使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
在下文中一共展示了Comparisons類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: allclose
def allclose(a, b, rtol=1e-05, atol=1e-08, axis=None):
'''Return true if all items are equal within given tolerances
Parameters:
rtol - relative tolerance
atol - absolute tolerance
'''
if axis:
return _cmps.allTrue(_cmps.almostEqualTo(a, b, rtol, atol), axis)
else:
return _cmps.allTrue(_cmps.almostEqualTo(a, b, rtol, atol))
示例2: where
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"
示例3: logical_not
def logical_not(a):
'''Return true if a == 0, itemwise'''
return _cmps.logicalNot(a)
示例4: not_equal
def not_equal(a, b):
'''Return true if a != b, itemwise'''
return _cmps.logicalNot(_cmps.equalTo(a, b))
示例5: equal
def equal(a, b):
'''Return true if a == b, itemwise'''
if a is None or b is None:
return False
return _cmps.equalTo(a, b)
示例6: less_equal
def less_equal(a, b):
'''Return true if a <= b, itemwise'''
return _cmps.lessThanOrEqualTo(a, b)
示例7: less
def less(a, b):
'''Return true if a < b, itemwise'''
return _cmps.lessThan(a, b)
示例8: nonzero
def nonzero(a):
'''Return the indices for items that are non-zero'''
return _cmps.nonZero(a)
示例9: logical_xor
def logical_xor(a, b):
'''Return true if a != 0 ^ b != 0, itemwise'''
return _cmps.logicalXor(a, b)
示例10: any
def any(a, axis=None): #@ReservedAssignment
'''Return true if any items are true'''
if axis:
return _cmps.anyTrue(a, axis)
else:
return _cmps.anyTrue(a)
示例11: isfinite
def isfinite(a):
'''Return true if a is not infinite and not a NaN, itemwise'''
return _cmps.isFinite(a)
示例12: isneginf
def isneginf(a):
'''Return true if a is negative infinite, itemwise'''
return _cmps.isNegativeInfinite(a)
示例13: isposinf
def isposinf(a):
'''Return true if a is positive infinite, itemwise'''
return _cmps.isPositiveInfinite(a)
示例14: isinf
def isinf(a):
'''Return true if a is infinite, itemwise'''
return _cmps.isInfinite(a)
示例15: isnan
def isnan(a):
'''Return true if a is a NaN, itemwise'''
return _cmps.isNaN(a)