Re: Scipy and information theory
Ralf Gommers <[email protected]> Fri, 8 Nov 2019 10:54:32 -0500
| Newsgroups | gmane.comp.python.scientific.user |
|---|---|
| Message-ID | <CABL7CQh=LDNJfH+P7tJQz2wB8SyeY3uRKRK5NFYs4eWHxYnYTg@mail.gmail.com> |
Hi Iyán, On Thu, Nov 7, 2019 at 12:21 PM Iyán Méndez Veiga <[email protected]> wrote: > 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). > This does sound like a useful feature to add to these functions. I'm not sure how easy it is to add a keyword to those functions though, since the ufunc machinery may be limited in flexibility. Maybe someone else can say straight away. If you want to start looking into implementing this, here are some notes of where to start: http://scipy.github.io/devdocs/dev/core-dev/index.html#scipy-special Cheers, Ralf > The workaround I am using with xlogy(x,y) (and similar functions) is > multiplying x array by log2(e). > > Best wishes, > Iyán > > > _______________________________________________ > SciPy-User mailing list > [email protected] > https://mail.python.org/mailman/listinfo/scipy-user > _______________________________________________ SciPy-User mailing list [email protected] https://mail.python.org/mailman/listinfo/scipy-user