Return (x1 < x2) element-wise. Unlike `numpy.greater`, this comparison is performed by first stripping whitespace characters from the end of the string. This behavior is provided for backward-compatibility with numarray. Parameters ---------- x1, x2 : array_like of st
(x1, x2)
| 231 | |
| 232 | @array_function_dispatch(_binary_op_dispatcher) |
| 233 | def less(x1, x2): |
| 234 | """ |
| 235 | Return (x1 < x2) element-wise. |
| 236 | |
| 237 | Unlike `numpy.greater`, this comparison is performed by first |
| 238 | stripping whitespace characters from the end of the string. This |
| 239 | behavior is provided for backward-compatibility with numarray. |
| 240 | |
| 241 | Parameters |
| 242 | ---------- |
| 243 | x1, x2 : array_like of str or unicode |
| 244 | Input arrays of the same shape. |
| 245 | |
| 246 | Returns |
| 247 | ------- |
| 248 | out : ndarray |
| 249 | Output array of bools. |
| 250 | |
| 251 | See Also |
| 252 | -------- |
| 253 | equal, not_equal, greater_equal, less_equal, greater |
| 254 | |
| 255 | Examples |
| 256 | -------- |
| 257 | >>> import numpy as np |
| 258 | >>> x1 = np.array(['a', 'b', 'c']) |
| 259 | >>> np.char.less(x1, 'b') |
| 260 | array([True, False, False]) |
| 261 | |
| 262 | """ |
| 263 | return compare_chararrays(x1, x2, '<', True) |
| 264 | |
| 265 | |
| 266 | @set_module("numpy.char") |
no outgoing calls
searching dependent graphs…