# Logic functions¶

## Truth value testing¶

 all (a[, axis, out]) Returns True if all elements evaluate to True. any (a[, axis, out]) Test whether any elements of an array evaluate to True along an axis.

## Array contents¶

 isfinite (x[, out]) Returns True for each element that is a finite number. isinf (x[, out]) Shows which elements of the input are positive or negative infinity. Returns a numpy boolean scalar or array resulting from an element-wise test for positive or negative infinity. isnan (x[, out]) Returns a numpy boolean scalar or array resulting from an element-wise test for Not a Number (NaN). isneginf (x[, y]) Return True where x is -infinity, and False otherwise. isposinf (x[, y]) Shows which elements of the input are positive infinity.

## Array type testing¶

 iscomplex (x) Return a bool array, True if element is complex (non-zero imaginary part). iscomplexobj (x) Return True if x is a complex type or an array of complex numbers. isfortran (a) Returns True if array is arranged in Fortran-order and dimension > 1. isreal (x) Returns a bool array where True if the corresponding input element is real. isrealobj (x) Return True if x is not a complex type. isscalar (num) Returns True if the type of num is a scalar type.

## Logical operations¶

 logical_and (x1, x2[, out]) Compute the truth value of x1 AND x2 elementwise. logical_or (x1, x2[, out]) Compute the truth value of x1 OR x2 elementwise. logical_not (x[, out]) Compute the truth value of NOT x elementwise. logical_xor (x1, x2[, out]) Compute the truth value of x1 XOR x2 elementwise.

## Comparison¶

 allclose (a, b[, rtol, atol]) Returns True if two arrays are element-wise equal within a tolerance. array_equal (a1, a2) True if two arrays have the same shape and elements, False otherwise. array_equiv (a1, a2) Returns True if input arrays are shape consistent and all elements equal.
 greater (x1, x2[, out]) Return (x1 > x2) element-wise. greater_equal (x1, x2[, out]) Element-wise True if first array is greater or equal than second array. less (x1, x2[, out]) Returns (x1 < x2) element-wise. less_equal (x1, x2[, out]) Returns (x1 <= x2) element-wise. equal (x1, x2[, out]) Returns elementwise x1 == x2 in a bool array. not_equal (x1, x2[, out]) Return (x1 != x2) element-wise.

numpy.extract

numpy.all