邏輯函數(shù)
真值測試
- all(a[, axis, out, keepdims]) 測試沿給定軸的所有數(shù)組元素是否都計算為True陪腌。
- any(a[, axis, out, keepdims]) 測試給定軸上的任何數(shù)組元素是否為True青灼。
數(shù)組內(nèi)容
- isfinite(x, /[, out, where, casting, order, …]) 測試元素的有限性(不是無窮大或不是數(shù)字)。
- isinf(x, /[, out, where, casting, order, …]) 對正或負無窮大進行元素級別測試妓盲。
- isnan(x, /[, out, where, casting, order, …]) 元素級別的為NaN測試并將結(jié)果作為布爾數(shù)組返回杂拨。
- isnat(x, /[, out, where, casting, order, …]) 元素級別為NaT(不是時間)測試并將結(jié)果作為布爾數(shù)組返回。
- isneginf(x[, out]) 元素級別測試負無窮大的元素悯衬,返回結(jié)果為bool數(shù)組弹沽。
- isposinf(x[, out]) 元素級別測試元素為正無窮大,返回結(jié)果為bool數(shù)組筋粗。
數(shù)組類型測試
- iscomplex(x) 返回一個bool數(shù)組策橘,如果輸入元素很復(fù)雜,則返回True娜亿。
- iscomplexobj(x) 檢查復(fù)雜類型或復(fù)數(shù)數(shù)組丽已。
- isfortran(a) 如果數(shù)組是Fortran連續(xù)但不是C連續(xù),則返回True买决。
- isreal(x) 返回一個bool數(shù)組沛婴,如果輸入元素是實數(shù),則返回True策州。
- isrealobj(x) 如果x是非復(fù)數(shù)類型或復(fù)數(shù)數(shù)組瘸味,則返回True。
- isscalar(num) 如果num的類型是標(biāo)量類型够挂,則返回True旁仿。
邏輯運算
- logical_and(x1, x2, /[, out, where, …]) 逐個元素計算x1和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]) 如果兩個數(shù)組在容差范圍內(nèi)在元素方面相等办悟,則返回True尘奏。
- isclose(a, b[, rtol, atol, equal_nan]) 返回一個布爾數(shù)組,其中兩個數(shù)組在容差范圍內(nèi)是元素相等的病蛉。
- array_equal(a1, a2) 如果兩個數(shù)組具有相同的形狀和元素炫加,則為真,否則為False铺然。
- array_equiv(a1, a2) 如果輸入數(shù)組的形狀一致且所有元素相等俗孝,則返回True。
- greater(x1, x2, /[, out, where, casting, …]) 逐個元素方式返回(x1> x2)的真值魄健。
- greater_equal(x1, x2, /[, out, where, …]) 逐個元素方式返回(x1> = x2)的真值赋铝。
- less(x1, x2, /[, out, where, casting, …]) 逐個元素方式返回(x1
- less_equal(x1, x2, /[, out, where, casting, …]) 逐個元素方式返回(x1 =
- equal(x1, x2, /[, out, where, casting, …]) 逐個元素返回(x1 == x2)。
- not_equal(x1, x2, /[, out, where, casting, …]) 逐個元素返回 Return (x1 != x2)沽瘦。