Skip to main content
`Ctrl`+`K`

# numpy.char.less

char.less(x1, x2)

  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 str or unicode

      Input arrays of the same shape.

  Returns:
    out ndarray

      Output array of bools.

  See also

  `equal`, `not_equal`, `greater_equal`, `less_equal`, `greater`

  Examples

      >>> import numpy as np
      >>> x1 = np.array(['a', 'b', 'c'])
      >>> np.char.less(x1, 'b')
      array([True, False, False])