{"id":4654,"library":"numpy-minmax","title":"NumPy MinMax","description":"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.","status":"active","version":"0.5.0","language":"en","source_language":"en","source_url":"https://github.com/nomonosound/numpy-minmax","tags":["numpy","minmax","optimization","performance","array","simd","audio-processing"],"install":[{"cmd":"pip install numpy-minmax","lang":"bash","label":"Install latest version"}],"dependencies":[{"reason":"Core functionality relies on NumPy arrays; compatible with numpy >=1.21,<2 for version 0.3.0 and later.","package":"numpy","optional":false}],"imports":[{"symbol":"minmax","correct":"from numpy_minmax import minmax"}],"quickstart":{"code":"import numpy as np\nfrom numpy_minmax import minmax\n\narr = np.arange(1337, dtype=np.float32)\nmin_val, max_val = minmax(arr)\n\nprint(f\"Min value: {min_val}\")\nprint(f\"Max value: {max_val}\")\n# Expected output: Min value: 0.0, Max value: 1336.0","lang":"python","description":"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)`."},"warnings":[{"fix":"Ensure input arrays are `float32` or `int16` and are C-contiguous, F-contiguous, or 1D strided when optimal performance is critical.","message":"Performance benefits of `numpy-minmax` are primarily realized for `float32` and `int16` arrays that are C-contiguous, F-contiguous, or 1D strided. For other data types or strided arrays with `ndim >= 2`, the function falls back to `numpy.amin` and `numpy.amax`, negating any performance gain.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always check the `CHANGELOG.md` or PyPI metadata for the `requires_python` field before upgrading or deploying to new Python environments.","message":"The library has a history of adjusting Python version support with minor releases. For example, version 0.5.0 added Python 3.13 support, while the upcoming 0.6.0 will remove Python 3.9 support. Users should consult the `CHANGELOG.md` on GitHub or PyPI for supported Python versions to ensure compatibility.","severity":"breaking","affected_versions":"0.1.0 - 0.5.0 (and future versions)"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}