# Fix documentation of entropy function #3018

Merged
merged 1 commit into from May 4, 2014

## Conversation

Projects
None yet
4 participants
Contributor

### captainwhippet commented Apr 28, 2014

 Fix the documentation of the entropy function to correct the formula so it reflects the calculation used in the code. Also mention the unit of the value returned, See also this stackoverflow question: Matplotlib mlab entropy calculation incorrect?

### efiring reviewed Apr 28, 2014

 .. math:: \sum p_i \log_2(p_i) \sum p_i \log(p_i)

#### efiring Apr 28, 2014

Member

I think this needs a minus sign; and it would be clearer if you used "\ln" rather than "\log".

Member

### efiring commented Apr 29, 2014

 The Travis failure is unrelated. For the sake of reducing clutter in the history, I would prefer to see the 2 commits squashed down to one and force-pushed.
 Fix documentation of entropy function 
Fix the documentation of the entropy function to correct the formula so
it reflects the calculation used in the code. Also mention the unit of
the value returned,
 1921de5 
Contributor

### captainwhippet commented May 4, 2014

 OK, I have figured out how to do that and it's done

### efiring added a commit that referenced this pull request May 4, 2014

 Merge pull request #3018 from captainwhippet/master 
Fix documentation of entropy function
 ef462e4 

### efiring merged commit ef462e4 into matplotlib:master May 4, 2014 1 check failed

#### 1 check failed

continuous-integration/travis-ci The Travis CI build failed
Details
Member

### efiring commented May 4, 2014

 Thank you.