MCPcopy
hub / github.com/numpy/numpy / less

Function less

numpy/_core/defchararray.py:233–263  ·  view source on GitHub ↗

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)

Source from the content-addressed store, hash-verified

231
232@array_function_dispatch(_binary_op_dispatcher)
233def 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")

Callers 10

__lt__Method · 0.90
test_basic_ufuncsMethod · 0.90
test_minmax_funcMethod · 0.90
__lt__Method · 0.85
masked_lessFunction · 0.85
test_testUfuncs1Method · 0.85
test_testOddFeaturesMethod · 0.85
test_testMinMax2Method · 0.85

Calls

no outgoing calls

Tested by 6

test_basic_ufuncsMethod · 0.72
test_minmax_funcMethod · 0.72
test_testUfuncs1Method · 0.68
test_testOddFeaturesMethod · 0.68
test_testMinMax2Method · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…