Skip to content

Commit ef462e4

Browse files
committed
Merge pull request matplotlib#3018 from captainwhippet/master
Fix documentation of entropy function
2 parents 235a761 + 1921de5 commit ef462e4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/matplotlib/mlab.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -1525,11 +1525,11 @@ def cohere_pairs( X, ij, NFFT=256, Fs=2, detrend=detrend_none,
15251525

15261526
def entropy(y, bins):
15271527
r"""
1528-
Return the entropy of the data in *y*.
1528+
Return the entropy of the data in *y* in units of nat.
15291529
15301530
.. math::
15311531
1532-
\sum p_i \log_2(p_i)
1532+
-\sum p_i \ln(p_i)
15331533
15341534
where :math:`p_i` is the probability of observing *y* in the
15351535
:math:`i^{th}` bin of *bins*. *bins* can be a number of bins or a

0 commit comments

Comments
 (0)