[Numpy-discussion] New ufuncs
Charles R Harris
Thu Nov 6 16:36:25 CST 2008
On Thu, Nov 6, 2008 at 3:17 PM, T J <email@example.com> wrote:
> On Thu, Nov 6, 2008 at 1:48 PM, Charles R Harris
> <firstname.lastname@example.org> wrote:
> > What is your particular interest in these other bases and why would
> > they be better than working in base e and converting at the end?
> The interest is in information theory, where quantities are
> (standardly) represented in bits. So log2 quantities are often stored
> by the user and then passed into functions or classes. The main
> reason I'd like to shy away from conversions is that I also make use
> of generators/iterators and having next() convert to bits before each
> yield is not ideal (as these things are often slow enough and will be
> called many times).
I could add exp2, log2, and logaddexp2 pretty easily. Almost too easily, I
don't want to clutter up numpy with a lot of functions. However, if there is
a community for these functions I will put them in.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Numpy-discussion