逻辑函数

真值检验

all (a) [, axis, out, keepdims, where] )

测试沿给定轴的所有数组元素的计算结果是否为真。

any (a) [, axis, out, keepdims, where] )

测试沿给定轴的任何数组元素的计算结果是否为true。

数组内容

isfinite (x,) [, out, where, casting, order, ...] )

测试元素的有限性(不是无限或不是数字)。

isinf (x,) [, out, where, casting, order, ...] )

正无穷大或负无穷大的测试元素。

isnan (x,) [, out, where, casting, order, ...] )

对NaN进行逐元素测试,并将结果作为布尔数组返回。

isnat (x,) [, out, where, casting, order, ...] )

为nat测试元素wise(不是时间),并将结果作为布尔数组返回。

isneginf (x) [, out] )

测试元素wise是否为负无穷大,将结果作为bool数组返回。

isposinf (x) [, out] )

测试元素wise是否为正无穷大,将结果作为bool数组返回。

数组类型测试

iscomplex [(x)]

返回bool数组,如果输入元素复杂,则返回true。

iscomplexobj [(x)]

检查复数类型或复数数组。

isfortran (a)

检查数组是否是Fortran连续的,但是 not C连续的。

isreal [(x)]

返回bool数组,如果输入元素为实数,则返回true。

isrealobj [(x)]

如果x不是复杂类型或复数数组,则返回true。

isscalar \(元素)

如果类型为 element 是标量类型。

逻辑运算

logical_and \(x1,x2,)/[, out, where, ...] )

计算x1和x2元素的真值。

logical_or \(x1,x2,)/[, out, where, casting, ...] )

计算x1或x2元素的真值。

logical_not (x,) [, out, where, casting, ...] )

计算非x元素的真值。

logical_xor \(x1,x2,)/[, out, where, ...] )

按元素计算x1 xor x2的真值。

比较

allclose (a,b) [, rtol, atol, equal_nan] )

如果两个数组在一个公差内按元素方向相等,则返回true。

isclose (a,b) [, rtol, atol, equal_nan] )

返回一个布尔数组,其中两个数组在一个公差内按元素方向相等。

array_equal \(a1,a2)[, equal_nan] )

如果两个数组的形状和元素相同,则为true,否则为false。

array_equiv [(a1,a2)]

如果输入数组的形状一致且所有元素都相等,则返回true。

greater \(x1,x2,)/[, out, where, casting, ...] )

返回(x1>x2)元素的真值。

greater_equal \(x1,x2,)/[, out, where, ...] )

返回(x1>=x2)元素的真值。

less \(x1,x2,)/[, out, where, casting, ...] )

返回(x1<x2)元素的真值。

less_equal \(x1,x2,)/[, out, where, casting, ...] )

返回(x1<=x2)元素的真值。

equal \(x1,x2,)/[, out, where, casting, ...] )

返回(x1==x2)元素。

not_equal \(x1,x2,)/[, out, where, casting, ...] )

返回(X1!=x2)元件方面。