邏輯函數#

真值測試#

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

測試沿著給定軸的所有陣列元素是否都評估為 True。

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(非時間)並將結果作為布林陣列傳回。

isneginf(x[, out])

逐元素測試負無限大,將結果作為布林陣列傳回。

isposinf(x[, out])

逐元素測試正無限大,將結果作為布林陣列傳回。

陣列類型測試#

iscomplex(x)

傳回布林陣列,如果輸入元素為複數則為 True。

iscomplexobj(x)

檢查複數類型或複數陣列。

isfortran(a)

檢查陣列是否為 Fortran 連續但不是 C 連續。

isreal(x)

傳回布林陣列,如果輸入元素為實數則為 True。

isrealobj(x)

如果 x 不是複數類型或複數陣列,則傳回 True。

isscalar(element)

如果 element 的類型為純量類型,則傳回 True。

邏輯運算#

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

逐元素計算 x1 AND x2 的真值。

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

逐元素計算 x1 OR x2 的真值。

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

逐元素計算 NOT 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)。