Logic functions#

Truth value testing#

 `all`(a[, axis, out, keepdims]) Tests whether all array elements along a given axis evaluate to True. `any`(a[, axis, out, keepdims]) Tests whether any array elements along a given axis evaluate to True. `union1d`(arr1, arr2) Find the union of two arrays.

Array contents#

 `isfinite`(x, /[, out, casting, dtype]) Tests finiteness elementwise. `isinf`(x, /[, out, casting, dtype]) Tests if each element is the positive or negative infinity. `isnan`(x, /[, out, casting, dtype]) Tests if each element is a NaN. `isneginf`(x[, out]) Test element-wise for negative infinity, return result as bool array. `isposinf`(x[, out]) Test element-wise for positive infinity, return result as bool array.

Array type testing#

 Returns a bool array, where True if input element is complex. Check for a complex type or an array of complex numbers. Returns True if the array is Fortran contiguous but not C contiguous. Returns a bool array, where True if input element is real. Return True if x is a not complex type or an array of complex numbers. `isscalar`(element) Returns True if the type of num is a scalar type.

Logic operations#

 `logical_and`(x1, x2, /[, out, casting, dtype]) Computes the logical AND of two arrays. `logical_or`(x1, x2, /[, out, casting, dtype]) Computes the logical OR of two arrays. `logical_not`(x, /[, out, casting, dtype]) Computes the logical NOT of an array. `logical_xor`(x1, x2, /[, out, casting, dtype]) Computes the logical XOR of two arrays.

Comparison#

 `allclose`(a, b[, rtol, atol, equal_nan]) Returns True if two arrays are element-wise equal within a tolerance. `isclose`(a, b[, rtol, atol, equal_nan]) Returns a boolean array where two arrays are equal within a tolerance. `array_equal`(a1, a2[, equal_nan]) Returns `True` if two arrays are element-wise exactly equal. `array_equiv`(a1, a2) Returns `True` if all elements are equal or shape consistent, i.e., one input array can be broadcasted to create the same shape as the other. `greater`(x1, x2, /[, out, casting, dtype]) Tests elementwise if `x1 > x2`. `greater_equal`(x1, x2, /[, out, casting, dtype]) Tests elementwise if `x1 >= x2`. `less`(x1, x2, /[, out, casting, dtype]) Tests elementwise if `x1 < x2`. `less_equal`(x1, x2, /[, out, casting, dtype]) Tests elementwise if `x1 <= x2`. `equal`(x1, x2, /[, out, casting, dtype]) Tests elementwise if `x1 == x2`. `not_equal`(x1, x2, /[, out, casting, dtype]) Tests elementwise if `x1 != x2`.