{"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":"python","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,"search_vec":"'0.5.0':57 '2.3':30 '2025':66 'achiev':26 'activ':50 'array':24,71 'audio':74 'audio-process':73 'avx/avx512':46 'c':41 'call':34 'design':11 'effici':13 'fast':8 'faster':32 'find':14 'frequent':53 'implement':42 'instruct':45 'june':65 'latest':60 'leverag':40 'librari':10,48 'maintain':51 'maximum':19 'minimum':17 'minmax':2,5,68 'numpi':1,4,23,67 'numpy-minmax':3 'numpy.amax':37 'numpy.amin':35 'optim':69 'perform':70 'process':75 'python':9 'releas':54,62 'rough':29 'separ':38 'signific':27 'simd':44,72 'speedup':28 'stabl':61 'valu':20 'version':56 'within':21 'x':31","created_at":"2026-04-12T14:01:54.362902+00:00","updated_at":"2026-04-16T17:25:36.912253+00:00","problems":[{"fix":"Ensure the library is installed using pip: `pip install numpy-minmax`","cause":"The `numpy-minmax` library has not been installed in your Python environment or the environment where you are running your script.","error":"ModuleNotFoundError: No module named 'numpy_minmax'"},{"fix":"Change the function call from `numpy_minmax.min_max(arr)` to `numpy_minmax.minmax(arr)`.","cause":"You are attempting to call a function named `min_max` (with an underscore) which does not exist. The correct function name is `minmax` (without an underscore).","error":"AttributeError: module 'numpy_minmax' has no attribute 'min_max'"},{"fix":"Before calling `numpy_minmax.minmax`, ensure the array is not empty. You can add a check like `if arr.size > 0: min_val, max_val = numpy_minmax.minmax(arr)`.","cause":"The `numpy_minmax.minmax` function was called with an empty NumPy array, which does not have a defined minimum or maximum value without an identity element.","error":"ValueError: zero-size array to reduction operation minmax which has no identity"},{"fix":"Convert the Python list to a NumPy array before passing it to the function: `import numpy as np; my_list = [1, 2, 3]; my_array = np.array(my_list); min_val, max_val = numpy_minmax.minmax(my_array)`.","cause":"The `numpy_minmax.minmax` function expects a NumPy array as input, but a standard Python list was provided instead.","error":"TypeError: 'list' object cannot be interpreted as an array"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":"0.6.0","cli_name":"","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/nomonosound/numpy-minmax","docs":null,"changelog":null,"pypi":"https://pypi.org/project/numpy-minmax/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["data"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-08-30","next_check":"2026-07-28","install_tag":null}}