Not a ready-made function but a compact and reasonably fast snippet:

(a<value).mean()

You can (at least on my machine) squeeze out a few percent better performance by using np.count_nonzero

np.count_nonzero(a<value) / a.size

but tbh I wouldn't even bother.

Answer from loopy walt on Stack Overflow
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.quantile.html
numpy.quantile — NumPy v2.5.dev0 Manual
If q is a single probability and axis=None, then the result is a scalar. If multiple probability levels are given, first axis of the result corresponds to the quantiles. The other axes are the axes that remain after the reduction of a. If the input contains integers or floats smaller than float64, the output data-type is float64.
🌐
GeeksforGeeks
geeksforgeeks.org › python › numpy-quantile-in-python
numpy.quantile() in Python - GeeksforGeeks
April 22, 2025 - numpy.quantile() function is used to find the qth quantile, which is the value below which a given percentage q of data falls in a NumPy array.
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.quantile.html
numpy.quantile — NumPy v2.1 Manual
If q is a single probability and axis=None, then the result is a scalar. If multiple probability levels are given, first axis of the result corresponds to the quantiles. The other axes are the axes that remain after the reduction of a. If the input contains integers or floats smaller than float64, the output data-type is float64.
🌐
Codecademy
codecademy.com › docs › python:numpy › built-in functions › .quantile()
Python:NumPy | Built-in Functions | .quantile() | Codecademy
April 19, 2025 - The .quantile() function in NumPy returns the qth quantile of an array along a specified axis. Quantiles are the division points that separate a data set into equal probabilities.
🌐
NumPy
numpy.org › doc › 2.0 › reference › generated › numpy.quantile.html
numpy.quantile — NumPy v2.0 Manual
If q is a single probability and axis=None, then the result is a scalar. If multiple probability levels are given, first axis of the result corresponds to the quantiles. The other axes are the axes that remain after the reduction of a. If the input contains integers or floats smaller than float64, the output data-type is float64.
🌐
Programiz
programiz.com › python-programming › numpy › methods › quantile
NumPy quantile()
The quantile is a statistical measure that represents the value below which a specific percentage of data falls. It helps analyze the distribution of a dataset. In NumPy, the quantile() function computes the q-th quantile of data along the specified axis.
🌐
JAX Documentation
docs.jax.dev › en › latest › _autosummary › jax.numpy.quantile.html
jax.numpy.quantile — JAX documentation
Compute the quantile of the data along the specified axis. JAX implementation of numpy.quantile().
Find elsewhere
🌐
NumPy
numpy.org › doc › 1.22 › reference › generated › numpy.quantile.html
numpy.quantile — NumPy v1.22 Manual
Given a vector V of length N, the q-th quantile of V is the value q of the way from the minimum to the maximum in a sorted copy of V. The values and distances of the two nearest neighbors as well as the method parameter will determine the quantile if the normalized ranking does not match the ...
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.nanquantile.html
numpy.nanquantile — NumPy v2.2 Manual
If multiple probability levels are given, first axis of the result corresponds to the quantiles. The other axes are the axes that remain after the reduction of a. If the input contains integers or floats smaller than float64, the output data-type is float64. Otherwise, the output data-type is the same as that of the input. If out is specified, that array is returned instead. ... The behavior of numpy.nanquantile is the same as that of numpy.quantile (ignoring nan values).
🌐
NumPy
numpy.org › doc › 2.1 › reference › generated › numpy.nanquantile.html
numpy.nanquantile — NumPy v2.1 Manual
If multiple probability levels are given, first axis of the result corresponds to the quantiles. The other axes are the axes that remain after the reduction of a. If the input contains integers or floats smaller than float64, the output data-type is float64. Otherwise, the output data-type is the same as that of the input. If out is specified, that array is returned instead. ... The behavior of numpy.nanquantile is the same as that of numpy.quantile (ignoring nan values).
🌐
Vultr Docs
docs.vultr.com › python › third-party › numpy › quantile
Python Numpy quantile() - Compute Quantiles | Vultr Docs
November 18, 2024 - The numpy.quantile() function in Python is crucial for statistical analysis, particularly when dividing a dataset into intervals based on quantile information. Quantiles are values that partition a probability distribution into contiguous intervals ...
🌐
GitHub
github.com › numpy › numpy › issues › 13267
np.quantile with wrong calculation? · Issue #13267 · numpy/numpy
April 5, 2019 - In the output, 0.73 means that only 73% of values are larger or equal than the determined quantile; by definition it should be >= 75% for p=0.25.
Author   Philipp-Seidel
🌐
NumPy
numpy.org › doc › 1.21 › reference › generated › numpy.quantile.html
numpy.quantile — NumPy v1.21 Manual
June 22, 2021 - Given a vector V of length N, the q-th quantile of V is the value q of the way from the minimum to the maximum in a sorted copy of V. The values and distances of the two nearest neighbors as well as the interpolation parameter will determine the quantile if the normalized ranking does not match ...
🌐
Statistics Globe
statisticsglobe.com › home › python programming language for statistics & data science › quantile of numpy array in python (example) | get quartile with np.quantile function
Quantile of NumPy Array in Python | Get Quartile with np.quantile Function
March 22, 2023 - This example demonstrates how to calculate the quartiles of a NumPy array. For this task, we can apply the quantile function in combination with the arange function. Within the arange function, we have to specify the intervals of our quantiles (i.e.
🌐
TutorialsPoint
tutorialspoint.com › numpy › numpy_quantile_function.htm
NumPy quantile() Function
The NumPy quantile() function computes the q-th quantile (or percentile) of the data along a specified axis. A quantile is a value below which a given percentage of observations fall.