Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
DEP: Remove expired interpolation kwarg from nanpercentile an…
…d ``nanquantile``
  • Loading branch information
jorenham committed Oct 15, 2025
commit 514fc6c3053f5f173dfb4042adf08ea26facaf35
26 changes: 2 additions & 24 deletions numpy/lib/_nanfunctions_impl.py
Original file line number Diff line number Diff line change
Expand Up @@ -1219,7 +1219,7 @@ def nanmedian(a, axis=None, out=None, overwrite_input=False, keepdims=np._NoValu

def _nanpercentile_dispatcher(
a, q, axis=None, out=None, overwrite_input=None,
method=None, keepdims=None, *, weights=None, interpolation=None):
method=None, keepdims=None, *, weights=None):
return (a, q, out, weights)


Expand All @@ -1234,7 +1234,6 @@ def nanpercentile(
keepdims=np._NoValue,
*,
weights=None,
interpolation=None,
):
"""
Compute the qth percentile of the data along the specified axis,
Expand Down Expand Up @@ -1313,11 +1312,6 @@ def nanpercentile(

.. versionadded:: 2.0.0

interpolation : str, optional
Deprecated name for the method keyword argument.

.. deprecated:: 1.22.0

Returns
-------
percentile : scalar or ndarray
Expand Down Expand Up @@ -1379,10 +1373,6 @@ def nanpercentile(
The American Statistician, 50(4), pp. 361-365, 1996

"""
if interpolation is not None:
method = fnb._check_interpolation_as_method(
method, interpolation, "nanpercentile")

a = np.asanyarray(a)
if a.dtype.kind == "c":
raise TypeError("a must be an array of real numbers")
Expand All @@ -1407,8 +1397,7 @@ def nanpercentile(


def _nanquantile_dispatcher(a, q, axis=None, out=None, overwrite_input=None,
method=None, keepdims=None, *, weights=None,
interpolation=None):
method=None, keepdims=None, *, weights=None):
return (a, q, out, weights)


Expand All @@ -1423,7 +1412,6 @@ def nanquantile(
keepdims=np._NoValue,
*,
weights=None,
interpolation=None,
):
"""
Compute the qth quantile of the data along the specified axis,
Expand Down Expand Up @@ -1500,11 +1488,6 @@ def nanquantile(

.. versionadded:: 2.0.0

interpolation : str, optional
Deprecated name for the method keyword argument.

.. deprecated:: 1.22.0

Returns
-------
quantile : scalar or ndarray
Expand Down Expand Up @@ -1565,11 +1548,6 @@ def nanquantile(
The American Statistician, 50(4), pp. 361-365, 1996

"""

if interpolation is not None:
method = fnb._check_interpolation_as_method(
method, interpolation, "nanquantile")

a = np.asanyarray(a)
if a.dtype.kind == "c":
raise TypeError("a must be an array of real numbers")
Expand Down