scipy.special.entr#

scipy.special.entr(x, out=None) = <ufunc 'entr'>#

Elementwise function for computing entropy.

\[\begin{split}\text{entr}(x) = \begin{cases} - x \log(x) & x > 0 \\ 0 & x = 0 \\ -\infty & \text{otherwise} \end{cases}\end{split}\]
Parameters
xndarray

Input array.

outndarray, optional

Optional output array for the function values

Returns
resscalar or ndarray

The value of the elementwise entropy function at the given points x.

See also

kl_div, rel_entr

Notes

This function is concave.

New in version 0.15.0.