skbio.diversity.alpha.
shannon
(counts, base=2)[source]¶Calculate Shannon entropy of counts, default in bits.
State: Experimental as of 0.4.0.
Shannon-Wiener diversity index is defined as:
where \(s\) is the number of OTUs and \(p_i\) is the proportion of the community represented by OTU \(i\).
Parameters: |
|
---|---|
Returns: | Shannon diversity index H. |
Return type: | double |
Notes
The implementation here is based on the description given in the SDR-IV online manual [1] except that the default logarithm base used here is 2 instead of \(e\).
References
[1] | http://www.pisces-conservation.com/sdrhelp/index.html |