numpy.char.greater#
- char.greater(x1, x2)[原始碼]#
元素級地返回 (x1 > x2)。
與
numpy.greater
不同,此比較會先去除字串結尾的空白字元後再執行。此行為是為了與 numarray 向後相容而提供的。- 參數:
- x1, x2str 或 unicode 的 array_like
相同形狀的輸入陣列。
- 返回:
- outndarray
布林值的輸出陣列。
範例
>>> import numpy as np >>> x1 = np.array(['a', 'b', 'c']) >>> np.char.greater(x1, 'b') array([False, False, True])