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 › doc › 2.1 › reference › generated › numpy.quantile.html
numpy.quantile — NumPy v2.1 Manual
The - 1 in the formulas for j and g accounts for Python’s 0-based indexing. The table above includes only the estimators from H&F that are continuous functions of probability q (estimators 4-9). NumPy also provides the three discontinuous estimators from H&F (estimators 1-3), where j is defined as above, m is defined as follows, and g is a function of the real-valued index = q*n + m - 1 and j. ... For backward compatibility with previous versions of NumPy, quantile provides four additional discontinuous estimators.
🌐
NumPy
numpy.org › devdocs › reference › generated › numpy.quantile.html
numpy.quantile — NumPy v2.5.dev0 Manual
The - 1 in the formulas for j and g accounts for Python’s 0-based indexing. The table above includes only the estimators from H&F that are continuous functions of probability q (estimators 4-9). NumPy also provides the three discontinuous estimators from H&F (estimators 1-3), where j is defined as above, m is defined as follows, and g is a function of the real-valued index = q*n + m - 1 and j. ... For backward compatibility with previous versions of NumPy, quantile provides four additional discontinuous estimators.
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.quantile.html
numpy.quantile — NumPy v2.4 Manual
June 22, 2021 - The - 1 in the formulas for j and g accounts for Python’s 0-based indexing. The table above includes only the estimators from H&F that are continuous functions of probability q (estimators 4-9). NumPy also provides the three discontinuous estimators from H&F (estimators 1-3), where j is defined as above, m is defined as follows, and g is a function of the real-valued index = q*n + m - 1 and j. ... For backward compatibility with previous versions of NumPy, quantile provides four additional discontinuous estimators.
🌐
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.0 › reference › generated › numpy.quantile.html
numpy.quantile — NumPy v2.0 Manual
The optional method parameter specifies ... desired quantile lies between two indexes i and j = i + 1. In that case, we first determine i + g, a virtual index that lies between i and j, where i is the floor and g is the fractional part of the index. The final result is, then, an interpolation of a[i] and a[j] based on g. During the computation of g, i and j are modified using correction constants alpha and beta whose choices depend on the method used. Finally, note that since Python uses 0-based ...
🌐
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.
🌐
Codecademy
codecademy.com › docs › python:numpy › built-in functions › .quantile()
Python:NumPy | Built-in Functions | .quantile() | Codecademy
April 19, 2025 - The .quantile() function returns the qth quantile(s) of an array as a NumPy array (ndarray) or a scalar (float64) if the result is a single value. The following example creates an array and then uses .quantile() to calculate various quantiles ...
🌐
NumPy
numpy.org › doc › 2.2 › reference › generated › numpy.quantile.html
numpy.quantile — NumPy v2.2 Manual
The - 1 in the formulas for j and g accounts for Python’s 0-based indexing. The table above includes only the estimators from H&F that are continuous functions of probability q (estimators 4-9). NumPy also provides the three discontinuous estimators from H&F (estimators 1-3), where j is defined as above, m is defined as follows, and g is a function of the real-valued index = q*n + m - 1 and j. ... For backward compatibility with previous versions of NumPy, quantile provides four additional discontinuous estimators.
Find elsewhere
🌐
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 ...
🌐
NumPy
numpy.org › doc › stable › reference › generated › numpy.nanquantile.html
numpy.nanquantile — NumPy v2.4 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, ...
🌐
Python Pool
pythonpool.com › home › blog › numpy quantile() explained with examples
Numpy Quantile() Explained With Examples - Python Pool
July 10, 2021 - They can be understood as the cut points dividing observations in the sample in the same way. Based on that, we can define NumPy quantile() as the function that helps us calculate the nth quantile of the given data along the specified axis.
🌐
Skytowner
skytowner.com › explore › numpy_quantile_method
NumPy | quantile method with Examples
Python●NumPy Tags · tocTable ... with 100+ top-tier guides Start your free 7-days trial now! Numpy's quantile(~) method returns the interpolated value at the specified quantile....
🌐
NumPy
numpy.org › doc › 2.3 › reference › generated › numpy.quantile.html
numpy.quantile — NumPy v2.3 Manual
The - 1 in the formulas for j and g accounts for Python’s 0-based indexing. The table above includes only the estimators from H&F that are continuous functions of probability q (estimators 4-9). NumPy also provides the three discontinuous estimators from H&F (estimators 1-3), where j is defined as above, m is defined as follows, and g is a function of the real-valued index = q*n + m - 1 and j. ... For backward compatibility with previous versions of NumPy, quantile provides four additional discontinuous estimators.
🌐
NumPy
numpy.org › doc › 1.17 › reference › generated › numpy.quantile.html
numpy.quantile — NumPy v1.17 Manual
February 18, 2020 - numpy.quantile(a, q, axis=None, out=None, overwrite_input=False, interpolation='linear', keepdims=False)[source]¶
🌐
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 ...