Logic functions

Truth value testing

all
any

Array contents

isfinite() Test element-wise for finite-ness (not infinity or not Not a Number).
isinf() Test element-wise for positive or negative infinity.
isnan() Test element-wise for Not a Number (NaN), return result as a bool array.
isneginf
isposinf

Array type testing

iscomplex
iscomplexobj
isfortran
isreal
isrealobj
isscalar

Logical operations

logical_and(x1) Compute the truth value of x1 AND x2 elementwise.
logical_or(x1) Compute the truth value of x1 OR x2 elementwise.
logical_not() Compute the truth value of NOT x elementwise.
logical_xor(x1) Compute the truth value of x1 XOR x2, element-wise.

Comparison

allclose
array_equal
array_equiv
greater(x1) Return the truth value of (x1 > x2) element-wise.
greater_equal(x1) Return the truth value of (x1 >= x2) element-wise.
less(x1) Return the truth value of (x1 < x2) element-wise.
less_equal(x1) Return the truth value of (x1 =< x2) element-wise.
equal(x1) Return (x1 == x2) element-wise.
not_equal(x1) Return (x1 != x2) element-wise.

Table Of Contents

Previous topic

numpy.count_nonzero

Next topic

numpy.all

This Page