NumPy MinMax

0.5.0 · active · verified Sun Apr 12

numpy-minmax is a fast Python library designed to efficiently find both the minimum and maximum values within a NumPy array. It achieves significant speedups (roughly 2.3x faster than calling `numpy.amin` and `numpy.amax` separately) by leveraging C implementations and SIMD instructions (AVX/AVX512). The library is actively maintained with frequent releases, with version 0.5.0 being the latest stable release as of June 2025.

Warnings

Install

Imports

Quickstart

Initialize a NumPy array and use `numpy_minmax.minmax()` to quickly get both the minimum and maximum values. The function returns a tuple `(min_value, max_value)`.

import numpy as np
from numpy_minmax import minmax

arr = np.arange(1337, dtype=np.float32)
min_val, max_val = minmax(arr)

print(f"Min value: {min_val}")
print(f"Max value: {max_val}")
# Expected output: Min value: 0.0, Max value: 1336.0

view raw JSON →