Re: Scipy and information theory
Iyán Méndez Veiga <[email protected]> Sun, 10 Nov 2019 13:30:20 +0100
| Newsgroups | gmane.comp.python.scientific.user |
|---|---|
| Message-ID | <9721637.vL8ZEpCK8U@master> |
El viernes, 8 de noviembre de 2019 18:13:32 (CET) Robert Lucente - Pipeline.Com escribió: > Why not use Python's built in fcn? > > https://docs.python.org/3/library/math.html#math.log2 > > math.log2(x) Because I want to avoid long (and slow) for loops and take advantage of numpy/ scipy element wise operations. That is why I prefer numpy.log2(x) over math.log2(x). My x is a high dimension array, not a scalar. > 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 Thanks Ralf, I'll have a look. Also waiting if someone else can say if it would be easy or hard to implement. Best wishes, Iyán