corewise_neg#

t3toolbox.corewise.corewise_neg(X)#
def corewise_neg(X: NDArrayTree) -> NDArrayTree:

Negate nested objects, X -> -X.

Examples

>>> import numpy as np
>>> import t3toolbox.corewise as cw
>>> X = (np.ones(3), (1, (), np.ones(2)))
>>> print(cw.corewise_neg(X))
(array([-1., -1., -1.]), (-1, (), array([-1., -1.])))
Parameters:

X (NDArrayTree)

Return type:

NDArrayTree