A fast python library for finding both min and max value 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. At Nomono, we use it for audio processing, but it can be applied any kind of float32 ndarray.
- Written in C and takes advantage of AVX/AVX512 for speed
- Roughly 2.3x speedup compared to the numpy amin+amax equivalent (tested on Intel CPU with numpy 1.24-1.26)
- The fast implementation is tailored for float32 arrays that are C-contiguous, F-contiguous or 1D strided. Strided arrays with ndim >= 2 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
Changelog
[0.3.1] - 2024-08-15
Changes
- Optimize (with AVX) the processing of contiguous int16 arrays. ~2.3x speedup compared to 0.3.0
For the complete changelog, go to CHANGELOG.md
Development
- Install dev/build/test dependencies as denoted in pyproject.toml
CC=clang pip install -e .
pytest
Running benchmarks
- Install diplib
pip install diplib
python scripts/perf_benchmark.py
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 Distribution
numpy_minmax-0.3.1.tar.gz
(13.0 kB
view hashes)
Built Distributions
Close
Hashes for numpy_minmax-0.3.1-pp39-pypy39_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1388b2446596348df3b724f768a8e820c61a13e45e3b093fa08ae340372b4e3b |
|
MD5 | e4fe3335d9a4e9045ff99263fc6ed00a |
|
BLAKE2b-256 | eb40aa6e7058e9cd8bf075df3d8e60350c7ed265ddfa80fc97cd17749a013e22 |
Close
Hashes for numpy_minmax-0.3.1-pp39-pypy39_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f2d0a44898fbd0e18dae7175f2dc449218f93f570e5ef757221928c128b25d4 |
|
MD5 | 24fd9670733e765f562657487d837426 |
|
BLAKE2b-256 | 232efff2df1c07a1ffa4766dd76a1594d2f5b5e1592b422f6ec89191e3155e79 |
Close
Hashes for numpy_minmax-0.3.1-pp39-pypy39_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f23ed1a1050d55b8512cf698b8d12800d711bcc3bea1b02ee8be785703a7386 |
|
MD5 | 4110cd3b06b0f33069f74384118e6886 |
|
BLAKE2b-256 | 3a72669a6c2502dbe088d5131b944b0b55c9a6055c4201a781b4b27ac8c4cefd |
Close
Hashes for numpy_minmax-0.3.1-pp39-pypy39_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f17a8b8807f30b75145f28c006ce0b11630630853ad2311aa3b6de517e1bb331 |
|
MD5 | 6507856ba4191e91dfd8e7b13b6d48e6 |
|
BLAKE2b-256 | 274299888757a9e76634ecb1358a4fed29a2c645805e4baff356f1642f07ea29 |
Close
Hashes for numpy_minmax-0.3.1-pp38-pypy38_pp73-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d57cdec9543d4e6812cdc92e347e149f825d8a9af60e79b4d9553672aa0d06c4 |
|
MD5 | 70bd59203ec24e16e3ba03a480290303 |
|
BLAKE2b-256 | 64b61c9645dcc49e549988f56af07e0ebefc231a1af04d78ea796c3b2fd3b73f |
Close
Hashes for numpy_minmax-0.3.1-pp38-pypy38_pp73-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bff63ab8acabba97e487f867fcb78250341e9b5676f03562b66fb51e61f5a74d |
|
MD5 | f37c3dab2eecae84614ee65d89899459 |
|
BLAKE2b-256 | a9f8ee77d31b7f440d6a6c5c70aacb7c0ccb31f0582246fdd3bf46feae3bf8cd |
Close
Hashes for numpy_minmax-0.3.1-pp38-pypy38_pp73-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1bcfc3eb1c047b68fdbf7ca5b89d5a509b12ec30e806d265c892611cbfc96047 |
|
MD5 | 72b599a5ac665907b14cb18822c9b325 |
|
BLAKE2b-256 | 8920bbb5dfcfc8a361888d1c1e752074dfe517d7b501d50910b00ad0c95d3bf4 |
Close
Hashes for numpy_minmax-0.3.1-pp38-pypy38_pp73-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2b1d1b7bce7a1bb8f7a9c5ba0d8ed8689b6974f9d6694f4e502aca307a4138c |
|
MD5 | 63342a910e811b94b931ec112ff80a7b |
|
BLAKE2b-256 | def2e88479eea9c5d97b4bb33dc9d8ca1e1859c91ca8e659b0d4330549f00fcb |
Close
Hashes for numpy_minmax-0.3.1-cp312-cp312-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5305f61b4ae834973c01ff637d615a697f7c74732503bf80bbde7470b2dec17 |
|
MD5 | f5b606eb458ed3538fdef704be9e24e7 |
|
BLAKE2b-256 | 0ad112d366f126dddf3d8a8bd443dc5695fa9eb33a9c14be2e329b616a298dec |
Close
Hashes for numpy_minmax-0.3.1-cp312-cp312-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 421aae134bea2cfc20f21c74d753bc7269df973f4ab55ad7ef484a7c66df9290 |
|
MD5 | 5d3e2f72a5b18a50f4de6689235bb527 |
|
BLAKE2b-256 | 5e357f0ba34aef6aea0385bfb0c7a7c17a3a1af7b9698e07c16fb9613ebe3318 |
Close
Hashes for numpy_minmax-0.3.1-cp312-cp312-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 819e0e89914bdeea007a3ebec32e8717e885e4a5c7e94adab2597be54a4e7725 |
|
MD5 | 443edefb2d453f24d3dbe06c6aad8443 |
|
BLAKE2b-256 | ea8d73381fa430ba705dae79b8477d1810c74fb1feed5fbb10e49a184178e838 |
Close
Hashes for numpy_minmax-0.3.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1b2e07ed444c11f216068b978776d5c6548c2b128d50d6a149db4619265924d6 |
|
MD5 | 2c67c5d4431f06f36172f9af4878ed29 |
|
BLAKE2b-256 | f3e6a0b712a1762adb4633a3eaa3d12f287e02e316d7991e669837f107e2db97 |
Close
Hashes for numpy_minmax-0.3.1-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5f6db55f166f55cde0d8af3b02f30107ff46ce8786f96cbc5d0feeb863169e6d |
|
MD5 | bc54cadb145661f8c3587ebfce616a6a |
|
BLAKE2b-256 | 1add75e46a2216818a5ea9a5baa02269350b2d3b74d9d0e20b48f8ffc5a6b9e8 |
Close
Hashes for numpy_minmax-0.3.1-cp312-cp312-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae79f8ff73a9b61ba3a9753b36d101578f825e88d2de4e771669c855d533ff25 |
|
MD5 | 8c6278c7032ab723acc61e6cd04e3935 |
|
BLAKE2b-256 | 839c4084af15faa0ec5883cbb8956389cbe0a936b246f34b28162afbba115f06 |
Close
Hashes for numpy_minmax-0.3.1-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d0b4e3903e3cf628b703108698c6ab5bdde85298bbeebf0404fa518dd544c8dd |
|
MD5 | fe8cb17597cd3f093d48bb061e70127a |
|
BLAKE2b-256 | ddc6d4ee0d14cc77b28d596840e49950fe17ad039b06b7f207a2eaa55e3e1b33 |
Close
Hashes for numpy_minmax-0.3.1-cp311-cp311-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d76b62368cedf5cc74b510408109c971ec21e63911594325ebb1474c2a32821 |
|
MD5 | 7ab672acff49b93b1be553c57e4a9899 |
|
BLAKE2b-256 | 540db7b3ec3843a027628a3c0973583430c2b41a4a19504039cbf0390f3b37a2 |
Close
Hashes for numpy_minmax-0.3.1-cp311-cp311-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | afde11ae5b683ea913f902905817671f8f7ce278f10a46f04a13963d31627b1b |
|
MD5 | 2b25eee0ff6c58d0867d3559101205f1 |
|
BLAKE2b-256 | 9a117df892c22f22fb202f8164d83c4f92e77077495a31f901135dd2d612ae1d |
Close
Hashes for numpy_minmax-0.3.1-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d518276b6acbc11c81725f5b70b0b91878514ae168f8eecba219fdcd6298dbd0 |
|
MD5 | 71967e17634e23d7f0f0819d7381ae70 |
|
BLAKE2b-256 | fe2a54d115cce3eefa2ab8f248c0eb26589510a803179dc6f392b41aea2ff90e |
Close
Hashes for numpy_minmax-0.3.1-cp311-cp311-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b050237c26705f67b97d0fa58df663738dcaa402ed8c6ab807c4c6e3f8beb878 |
|
MD5 | f1cf7783b0d221c95cd8d4bbb36819c3 |
|
BLAKE2b-256 | 80ca5d8943a15a37ba88a6fd290ee823f73b796f5e952ce29d928237c40a014b |
Close
Hashes for numpy_minmax-0.3.1-cp311-cp311-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85b8d66e444a2967fbc0b1e12bec2e5dfb072c826c9895d6a36e8bae0c407361 |
|
MD5 | 21c100c1efb220c68a2e55e3c81dcd10 |
|
BLAKE2b-256 | aa00fad38794b661e135a5d2dd8c671e70f34d02f595476064c66526f30c2014 |
Close
Hashes for numpy_minmax-0.3.1-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4a8aeb5770429877a4eb79fca8c7c987a64dadbd4ed2289b5626257787f74075 |
|
MD5 | 67021686faa066c85c7e8026c7de5f0d |
|
BLAKE2b-256 | c4cfb31b001ada7a620a48d0cd1316bdf0261549d955240c226132780697e51e |
Close
Hashes for numpy_minmax-0.3.1-cp310-cp310-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | abd718e7fe3e3db3052777da8c9ebae77b7f39730bdc7ec76bfb408f08f9295c |
|
MD5 | 563c962f198c97bc3a53fe378d12bd7d |
|
BLAKE2b-256 | 77b8985dd7ef066c169a70d7e66512a730204d1e2efd4ce41fbfa69597053d31 |
Close
Hashes for numpy_minmax-0.3.1-cp310-cp310-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8fa9b73068bacde63c3544f9f2a074cc55c0def722ee58ece256598a0053136a |
|
MD5 | 325ae444c71c5e91ce46ddeac0d8e223 |
|
BLAKE2b-256 | a2a7a48e88b04b71a4d4ea099a874e33b5c2c27ad114fed3f3ad4b64aee42f6d |
Close
Hashes for numpy_minmax-0.3.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4c658f948e7325f1c816c7fd6a355d937ca2c580234e3774372448a3e0074a24 |
|
MD5 | 664883ac923dbb1c3c28b7514a019029 |
|
BLAKE2b-256 | a160f2f212579d61b765b3e289efe4a04330fbb7fac39089d794853cfd6cd592 |
Close
Hashes for numpy_minmax-0.3.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67bdc7fceba8f825b99cf52d9a00c242704208497f5223b703ff59d178649ad0 |
|
MD5 | 5bb377d45e896cdc58ad32efe7f034b8 |
|
BLAKE2b-256 | 62ccbd6dc0d3bf9dcaebe07dd31ac501e77bf00077313e7a3ae6d163e90ad139 |
Close
Hashes for numpy_minmax-0.3.1-cp310-cp310-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 311cf7e8302669504fabd7ee033ce611110a1df74a506730d591b5fcc49f1913 |
|
MD5 | 6312c01aaeea1e323da86cb67525acc1 |
|
BLAKE2b-256 | 420c57067985d7a9cc8e923e00c8618c3489930c2d644c81b79353781dc6a3cf |
Close
Hashes for numpy_minmax-0.3.1-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6c0119ac1e19a8ceee95687e2dbd36e0b4086a042bf45079247565b1e94aa364 |
|
MD5 | 5db6790f9a246fd5eead2cdfb4904077 |
|
BLAKE2b-256 | 549d6433e14cdbe37e131442c4b399a5b2340a156602a4d41d27e98a74a174f8 |
Close
Hashes for numpy_minmax-0.3.1-cp39-cp39-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 95616b5bff56797cdef61924894a92950b62a345e1730bd997d6a17fee576a5d |
|
MD5 | cbbd04a402603b7874d2f0d268d9855a |
|
BLAKE2b-256 | 3fdc7df1b42f246c811a68ae17aac7c2d56da727536049624b8bc56c8666e049 |
Close
Hashes for numpy_minmax-0.3.1-cp39-cp39-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 38a3291862f5b30c30537cfe1079a91792f90ee908dc70e1f6a304fb28f9f498 |
|
MD5 | e967060e706f71b4b74a105292d9f80c |
|
BLAKE2b-256 | 3069fc512bf682b00e5ff9b2d745e45e95463192c83adbb600ba57b073e000a0 |
Close
Hashes for numpy_minmax-0.3.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5610f6276a2e71ecf94ccbc84cc5861456a8239b02954e47d35eae4f56f51591 |
|
MD5 | 8280a9ae42e70a48e19640126e3d93ec |
|
BLAKE2b-256 | 29de17410a76cb0ea599909ac3cca6b1f1770a288544fd55e5fdbbdfa6d3d754 |
Close
Hashes for numpy_minmax-0.3.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9172dc55458617f8208a9fa452001ab789c10d98be8cf533419b4680ffa3b103 |
|
MD5 | 66960ac733b215f167a8f32c092c930c |
|
BLAKE2b-256 | 6be739b2d9620bef595593badfc255145abf40759cc362abac262be5ccdb79df |
Close
Hashes for numpy_minmax-0.3.1-cp39-cp39-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5a088c3141f8d5a08e0228bff3c5d31219f9d686355ac707fc9d0ab6ceeb6271 |
|
MD5 | 96aad116ca9864a306d903c0231cf231 |
|
BLAKE2b-256 | 11928fe6948683c8d54f0175063090b377e8f5e5565f06217497cb6cbefa9060 |
Close
Hashes for numpy_minmax-0.3.1-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c73c8774b841b53793120b8dbcb9c9c851c9960f7e8e18467ca8e5ea96abcf6f |
|
MD5 | e3f12802308c4acac28ef4ac4302a347 |
|
BLAKE2b-256 | cf79cb81cfd58998454867ffd8c52000955341dc9a1bcd17ebb335c00776993f |
Close
Hashes for numpy_minmax-0.3.1-cp38-cp38-musllinux_1_2_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3594d9f7b090740bc0727bf7d828a104b9a35c8d12ef446a2c5ebb566d782a3a |
|
MD5 | c8106e4f6e8ad5da6640bc1beaffb5f6 |
|
BLAKE2b-256 | 7139084d09205e692555b3872081c4cc7921db33946d8900e4601d650e1542e8 |
Close
Hashes for numpy_minmax-0.3.1-cp38-cp38-musllinux_1_2_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 503805e2e0b82f64ed0a92bc87d04c9296b788276faddc0d185c5d28ee26caf5 |
|
MD5 | 0817bd38ed385dddefe8eedc6949990b |
|
BLAKE2b-256 | 74fab037ac5b7503716fe523477bb42b277a84b23005e64028c06e2bc83522d8 |
Close
Hashes for numpy_minmax-0.3.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 47e6895f6cdb9a3924de56724a67d6b8782a7573a1b6f6eaf08511693b6d85ad |
|
MD5 | 948606c98d20e081a954259a67658418 |
|
BLAKE2b-256 | 68c87cdd879ad0a50a1aed43078e326b43e23c6d159b949d97ac2ccbe44f9805 |
Close
Hashes for numpy_minmax-0.3.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c6a5610461658b3c2ba32124598f1f78edd876d5c855d2d5a9bacc2a2c5cd24 |
|
MD5 | f89a5fcc6c148ce74c775b54021246c3 |
|
BLAKE2b-256 | 5194daa2a76f5071170be6dcca61065a610fb80991b70439f37f56ae608c3da0 |
Close
Hashes for numpy_minmax-0.3.1-cp38-cp38-macosx_11_0_arm64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 445264fa11204694e095a3139417a153105575eef1f06aae878e8e450f97cf36 |
|
MD5 | 2fcaf23adef9caf40bc607a5b4edbefc |
|
BLAKE2b-256 | 2946e999323131a91099c2ba056892e0ba8ece5abdd865dbc111cf101ceb58a9 |