summaryrefslogtreecommitdiff
path: root/numpy/lib/nanfunctions.py
diff options
context:
space:
mode:
authorEric Wieser <wieser.eric@gmail.com>2017-12-10 10:59:21 -0800
committerEric Wieser <wieser.eric@gmail.com>2017-12-10 11:01:45 -0800
commitf2947e5917a2b2a8cbc6582f09944d5064321c8d (patch)
treea374fbab9f4596956a58488c151f7810289ee310 /numpy/lib/nanfunctions.py
parent5f01e54b20e38d483e8bab31bf5f953a860fe8d3 (diff)
downloadnumpy-f2947e5917a2b2a8cbc6582f09944d5064321c8d.tar.gz
DOC: Fixup percentile docstring, from review in gh-9213
Updates the two docstrings to match.
Diffstat (limited to 'numpy/lib/nanfunctions.py')
-rw-r--r--numpy/lib/nanfunctions.py33
1 files changed, 14 insertions, 19 deletions
diff --git a/numpy/lib/nanfunctions.py b/numpy/lib/nanfunctions.py
index b3f3bfc69..ca8c10031 100644
--- a/numpy/lib/nanfunctions.py
+++ b/numpy/lib/nanfunctions.py
@@ -1039,35 +1039,28 @@ def nanpercentile(a, q, axis=None, out=None, overwrite_input=False,
----------
a : array_like
Input array or object that can be converted to an array.
- q : float in range of [0,100] (or sequence of floats)
- Percentile to compute, which must be between 0 and 100
- inclusive.
- axis : {int, sequence of int, None}, optional
+ q : array_like of float
+ Percentile or sequence of percentiles to compute, which must be between
+ 0 and 100 inclusive.
+ axis : {int, tuple of int, None}, optional
Axis or axes along which the percentiles are computed. The
default is to compute the percentile(s) along a flattened
- version of the array. A sequence of axes is supported since
- version 1.9.0.
+ version of the array.
out : ndarray, optional
Alternative output array in which to place the result. It must
have the same shape and buffer length as the expected output,
but the type (of the output) will be cast if necessary.
overwrite_input : bool, optional
- If True, then allow use of memory of input array `a` for
- calculations. The input array will be modified by the call to
- `percentile`. This will save memory when you do not need to
- preserve the contents of the input array. In this case you
- should not make any assumptions about the contents of the input
- `a` after this function completes -- treat it as undefined.
- Default is False. If `a` is not already an array, this parameter
- will have no effect as `a` will be converted to an array
- internally regardless of the value of this parameter.
+ If True, then allow the input array `a` to be modified by intermediate
+ calculations, to save memory. In this case, the contents of the input
+ `a` after this function completes is undefined.
interpolation : {'linear', 'lower', 'higher', 'midpoint', 'nearest'}
This optional parameter specifies the interpolation method to
use when the desired quantile lies between two data points
``i < j``:
- * linear: ``i + (j - i) * fraction``, where ``fraction`` is
- the fractional part of the index surrounded by ``i`` and
- ``j``.
+ * linear: ``i + (j - i) * fraction``, where ``fraction``
+ is the fractional part of the index surrounded by ``i``
+ and ``j``.
* lower: ``i``.
* higher: ``j``.
* nearest: ``i`` or ``j``, whichever is nearest.
@@ -1097,7 +1090,9 @@ def nanpercentile(a, q, axis=None, out=None, overwrite_input=False,
See Also
--------
- nanmean, nanmedian, percentile, median, mean
+ nanmean
+ nanmedian : equivalent to ``nanpercentile(..., 50)``
+ percentile, median, mean
Notes
-----