MCPcopy Create free account
hub / github.com/numpy/numpy / negative

Function negative

numpy/array_api/_elementwise_functions.py:578–586  ·  view source on GitHub ↗

Array API compatible wrapper for :py:func:`np.negative `. See its docstring for more information.

(x: Array, /)

Source from the content-addressed store, hash-verified

576
577
578def negative(x: Array, /) -> Array:
579 """
580 Array API compatible wrapper for :py:func:`np.negative <numpy.negative>`.
581
582 See its docstring for more information.
583 """
584 if x.dtype not in _numeric_dtypes:
585 raise TypeError("Only numeric dtypes are allowed in negative")
586 return Array._new(np.negative(x._array))
587
588
589def not_equal(x1: Array, x2: Array, /) -> Array:

Callers 1

crossFunction · 0.85

Calls 1

_newMethod · 0.80

Tested by

no test coverage detected