Re: Scipy and information theory
"Robert Lucente - Pipeline.Com" <[email protected]> Sun, 10 Nov 2019 10:00:42 -0500
| Newsgroups | gmane.comp.python.scientific.user |
|---|---|
| Message-ID | <[email protected]> |
> Because I want to avoid long (and slow) for loops and take advantage of numpy/ scipy element wise operations I am embarrassed That was an amateur mistake on my part :-( -----Original Message----- From: SciPy-User <[email protected]> On Behalf Of Iyán Méndez Veiga Sent: Sunday, November 10, 2019 7:30 AM To: SciPy Users List <[email protected]> Subject: Re: [SciPy-User] Scipy and information theory 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 _______________________________________________ SciPy-User mailing list [email protected] https://mail.python.org/mailman/listinfo/scipy-user