A fast python library for finding both min and max in a NumPy array
Project description
numpy-minmax: a fast function for finding the minimum and maximum value in a numpy array
Numpy lacked an optimized minmax function, so we wrote our own.
- Written in C and takes advantage of AVX2 for speed
- Roughly 2.3x faster than the numpy amin+amax equivalent (tested with numpy 1.24-1.26)
- The fast implementation is tailored for C-contiguous 1-dimensional and 2-dimensional float32 arrays. Other types of arrays get processed with numpy.amin and numpy.amax, so no perf gain there.
Installation
$ pip install numpy-minmax
Usage
import numpy_minmax
import numpy as np
arr = np.arange(1337, dtype=np.float32)
min_val, max_val = numpy_minmax.minmax(arr) # 0.0, 1336.0
Development
- Install dev/build/test dependencies as denoted in setup.py
CC=clang pip install -e .
pytest
Acknowledgements
This library is maintained/backed by Nomono, a Norwegian audio AI startup.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
Close
Hashes for numpy_minmax-0.1.0-pp39-pypy39_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24e41ca1963b341d27235748ea1bb0502e8725b62efeed8e87d130b0eec8382a |
|
MD5 | 3ff6685943e5483b790316c5133addf2 |
|
BLAKE2b-256 | c1d5eb189e43e6d6b3fa27f93ca6976ae19276f7aa17bccf88510fa5dcb9d6cf |
Close
Hashes for numpy_minmax-0.1.0-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b683dfd2676dd2a64999720e460f21a478cd15f917452009c3da890151bf0ce3 |
|
MD5 | c5e846ac36c8b102c3e3e70ca6e77380 |
|
BLAKE2b-256 | 77c18cfae27c823303d4cddf5613110fcaa03bcb9c503cfbb6728ed70998c8a7 |
Close
Hashes for numpy_minmax-0.1.0-pp38-pypy38_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3ae3c12ae1e51d4064af3072cb2a576ec74e8caf730a98631606802a988ff4b1 |
|
MD5 | a71d8d5abb686777e6bc93a0ebb9b204 |
|
BLAKE2b-256 | 7178f4f37ccaa9b814d4020f07611ee1b1960ed03575e10c890e7135a4fc8a9f |
Close
Hashes for numpy_minmax-0.1.0-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56a0a3a07cda5f3771f88952028e9c6939403f0e76f9e6317690068f85e71f5a |
|
MD5 | 60276a127880b1dc1bf8ee7f619acba0 |
|
BLAKE2b-256 | f9b8d43c1641ae4c3ecbe83f984f421940ac767dd53bbe4858832a6786a4567b |
Close
Hashes for numpy_minmax-0.1.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4443e2365027d2138feb6523e17fde5181b899ab4b00fd39f9a310c1eb6ff28 |
|
MD5 | 761b59d1ef0fa498ef19d3a5fe3f0b8a |
|
BLAKE2b-256 | 37e3bdbbb1dff70134f84897a26027d17bb1aed5431e0056587e68e9a48af1f8 |
Close
Hashes for numpy_minmax-0.1.0-cp311-cp311-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04395c7ca071f287c3b562f0c0a9ada8b1e770a2323ddeec1a816448e1beb7eb |
|
MD5 | ee1220fe7a8e6472ad580cdc171d9001 |
|
BLAKE2b-256 | e22465adbd73514fe8ff78fa953dfba33636a26d5b70464f39bd6668c7fd7ffe |
Close
Hashes for numpy_minmax-0.1.0-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca8e52688ecf988bd8ab17fe5d34f0ead5d561512032c71e5c06d7e75de35a19 |
|
MD5 | 7b9e4feae8be39681f79a6e292e79a4c |
|
BLAKE2b-256 | beef6f56f48ff155b989a308713e76861cab4467b403b793cb5a178fd5662092 |
Close
Hashes for numpy_minmax-0.1.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6eef6f6a3dcde9677b79bd5beea952cf694a03bba7d166a0baa3f64a92b1984a |
|
MD5 | 1657c98a64c458b67ccbdddbb2540129 |
|
BLAKE2b-256 | 9bd059f810cec0be6799bab29d21a0e2fbdbef4e2cef91d6b293b401f5bbd14a |
Close
Hashes for numpy_minmax-0.1.0-cp310-cp310-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc241c3638db541e92281d4f88b4f7dd049e5f0e1de0cc71a9cd5ebe28f22576 |
|
MD5 | 47dece000f485fb2a6352c6b02fabf67 |
|
BLAKE2b-256 | 4b1de5dba4d35376ddca51e6347b3635b598f6bc79beee317b3c7a36289b10d5 |
Close
Hashes for numpy_minmax-0.1.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d9d88e37b502651694beeb4ae4525fe13525b037bb0702a5b94153fe55966aa |
|
MD5 | 4511b68c07b18f14a19c8198e8022daa |
|
BLAKE2b-256 | bf98a84ce44923ecdbe6da03a459025b99dcea7e40a1afe5002e0febdd1c0a1d |
Close
Hashes for numpy_minmax-0.1.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e93fa7b8e93c7280a1ce6cd41210d981589e7bf4b6afa175d179f912e7d186a2 |
|
MD5 | f7433d474187b542d2bf8f3ee596e522 |
|
BLAKE2b-256 | d959aaa16c8bd876caa9b6ddd91c04fd7e98f3cc08c088824908e2ab2c3b1cc1 |
Close
Hashes for numpy_minmax-0.1.0-cp39-cp39-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7a68973b94aad0f6d5f2291b49944123bd7b0755f010332916222623b8ab30db |
|
MD5 | 1c0e557fb8133d88364ac876cd7bfdb3 |
|
BLAKE2b-256 | c07acd81f1a04d673d7d69ed922d53f782bec1439b7984d582df32caee34d669 |
Close
Hashes for numpy_minmax-0.1.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab859fcfedd420edf6b6c82bdb08a75b1b8fd736eaec3c5d1f89d3f17608ecde |
|
MD5 | afcf2ca30577e4130286ea7c86e89778 |
|
BLAKE2b-256 | 777df3249e8a698e094268bbe3575aff8542f3bf10f663b0f9d3635bf4997530 |
Close
Hashes for numpy_minmax-0.1.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 61ec1f0a5fe357ccfb92cfce4c0c72f0f68c16597f6e30c809fbed34349be9a8 |
|
MD5 | 04ca2a7cc46b73e1dd71a6e9bacdb9e5 |
|
BLAKE2b-256 | 6e2978df9a2fe4e879a6e2553afb30ccc9d77c3c3d277b527aa5ef21043c37f6 |
Close
Hashes for numpy_minmax-0.1.0-cp38-cp38-musllinux_1_1_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b985cb467934b74d203e48b831b720ca2c31eb4b26b26a4c7dd3685d356d6bf5 |
|
MD5 | 71b10740135dc669e3349fc2b438975b |
|
BLAKE2b-256 | d2333579bf74e48c5e74047191308869096d84fe4c7087b99b34d4c83a4f3960 |
Close
Hashes for numpy_minmax-0.1.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0758f573c05ebeb6f1182ff3e6df0e761fb3cd857a7e21876ed0fd39b1330a8a |
|
MD5 | d42274c9f6eab033bfda3fb2acd7a8d7 |
|
BLAKE2b-256 | 118ca4a876e4f1b986a96d21fc3805cddc83c63f44ada7b563e041301af88e58 |