numpy.signbit

numpy.signbit(x[, out])

Returns element-wise True where signbit is set (less than zero).

Parameters:

x: array_like :

The input value(s).

Returns:

out : array_like, bool

Output.

Examples

>>> np.signbit(-1.2)
True
>>> np.signbit(np.array([1, -2.3, 2.1]))
array([False,  True, False], dtype=bool)

Previous topic

numpy.sinc

Next topic

numpy.frexp

This Page

Quick search