Open josef-pkt opened 10 years ago
Is there a way to negate a boolean, or to change the sign of a float inplace?
np.logical_not(arr, out=arr) np.negative(arr, out=arr)
might be useful for negating loglike and similar during optimization.
(asked on numpy mailing list)
Alternative in-place negation:
x *= -1.0
Is there a way to negate a boolean, or to change the sign of a float inplace?
np.logical_not(arr, out=arr) np.negative(arr, out=arr)
might be useful for negating loglike and similar during optimization.
(asked on numpy mailing list)