-
-
Notifications
You must be signed in to change notification settings - Fork 9.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
87377d4
commit a5d88e1
Showing
2 changed files
with
14 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
`np.bit_count` to compute the number of 1-bits in an integer | ||
------------------------------------------------------------ | ||
|
||
This new function counts the number of 1-bits in a number. | ||
These work on all the numpy integer types, as well as the | ||
builtin arbitrary-precision `Decimal` and `long` types. | ||
|
||
.. code-block:: python | ||
>>> a = np.array([2**i - 1 for i in range(16)]) | ||
>>> np.bit_count(a) | ||
array([ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -169,3 +169,5 @@ Miscellaneous | |
real_if_close | ||
|
||
interp | ||
|
||
bit_count |