numpy.char.equal#
- char.equal(x1, x2)[源代码]#
逐元素返回 (x1 == x2).
与
numpy.equal不同,此比较首先从字符串末尾去除空白字符.提供此行为是为了向后兼容 numarray.- 参数:
- x1, x2str 或 unicode 的类数组
具有相同形状的输入数组.
- 返回:
- outndarray
布尔值的输出数组.
参见
not_equal,greater_equal,less_equal,greater,less
示例
>>> import numpy as np >>> y = "aa " >>> x = "aa" >>> np.char.equal(x, y) array(True)