[Numpy-discussion] Regarding adding new function in Numpy
Matthew Brett
matthew.brett at gmail.com
Mon Jul 8 05:55:01 EDT 2019
Hi,
On Sun, Jul 7, 2019 at 11:41 PM ANURAG ANURAG <anurag at ph.iitr.ac.in> wrote:
>
> Sir,
> I was recently converting some Matlab codes into python, where I recently stumble upon bitget(n,x) function of Matlab, b = bitget(A,bit) returns the bit value at the position bit in integer array A. I was unable to find any Numpy equivalent of this, so should I create a pull request in Numpy for the same!
Thanks for the suggestion. I think Eric Wieser is right in his
comment on the related pull request:
https://github.com/numpy/numpy/pull/13937#issuecomment-509091992
The function is a one-liner in Python - albeit a slightly fancy
one-liner. Also - I have never had need of this function in Matlab or
Numpy, and had no idea it existed. So, I'd vote against, unless it
turned out it was much more common in use than my experience would
suggest,
Cheers,
Matthew
More information about the NumPy-Discussion
mailing list