Scipy and information theory

Iyán Méndez Veiga <[email protected]> Thu, 07 Nov 2019 13:11:55 +0100
Newsgroups gmane.comp.python.scientific.user
Message-ID <20976252.W2eyRVhfPJ@theotp40>
Hi,

I discovered recently some interesting functions in scipy that are useful in 
the context of information theory. In particular, xlogy, entr and rel_entr. 
However, for the calculations I want to do I am interested in using log2 
instead of natural logarithm. I was expecting to be able to choose the base 
with this functions but it is not possible.

Do you think it would be a nice feature to add to scipy? Maybe not for a 
general base, but at least the bases that are available in numpy (log2, 
log10). 

The workaround I am using with xlogy(x,y) (and similar functions) is 
multiplying x array by log2(e).

Best wishes,
Iyán