char.
endswith
返回一个布尔数组,该数组是 True 其中的字符串元素 a 以结束 suffix ,否则 False .
调用 str.endswith 元素的。
任选 start ,从该位置开始测试。任选 end 在那个位置停止比较。
输出一组bools。
参见
str.endswith
实例
>>> s = np.array(['foo', 'bar']) >>> s[0] = 'foo' >>> s[1] = 'bar' >>> s array(['foo', 'bar'], dtype='<U3') >>> np.char.endswith(s, 'ar') array([False, True]) >>> np.char.endswith(s, 'a', start=1, end=2) array([False, True])