Compute the qth quantile of the data along the specified dimension. Returns the qth quantiles(s) of the array elements. Parameters ---------- q : float or array-like of float Quantile to compute, which must be between 0 and 1 inclusive. dim : str
(
self,
q: ArrayLike,
dim: Dims = None,
*,
method: QuantileMethods = "linear",
keep_attrs: bool | None = None,
skipna: bool | None = None,
interpolation: QuantileMethods | None = None,
)
| 5309 | return self._from_temp_dataset(ds) |
| 5310 | |
| 5311 | def quantile( |
| 5312 | self, |
| 5313 | q: ArrayLike, |
| 5314 | dim: Dims = None, |
| 5315 | *, |
| 5316 | method: QuantileMethods = "linear", |
| 5317 | keep_attrs: bool | None = None, |
| 5318 | skipna: bool | None = None, |
| 5319 | interpolation: QuantileMethods | None = None, |
| 5320 | ) -> Self: |
| 5321 | """Compute the qth quantile of the data along the specified dimension. |
| 5322 | |
| 5323 | Returns the qth quantiles(s) of the array elements. |
| 5324 | |
| 5325 | Parameters |
| 5326 | ---------- |
| 5327 | q : float or array-like of float |
| 5328 | Quantile to compute, which must be between 0 and 1 inclusive. |
| 5329 | dim : str or Iterable of Hashable, optional |
| 5330 | Dimension(s) over which to apply quantile. |
| 5331 | method : str, default: "linear" |
| 5332 | This optional parameter specifies the interpolation method to use when the |
| 5333 | desired quantile lies between two data points. The options sorted by their R |
| 5334 | type as summarized in the H&F paper [1]_ are: |
| 5335 | |
| 5336 | 1. "inverted_cdf" |
| 5337 | 2. "averaged_inverted_cdf" |
| 5338 | 3. "closest_observation" |
| 5339 | 4. "interpolated_inverted_cdf" |
| 5340 | 5. "hazen" |
| 5341 | 6. "weibull" |
| 5342 | 7. "linear" (default) |
| 5343 | 8. "median_unbiased" |
| 5344 | 9. "normal_unbiased" |
| 5345 | |
| 5346 | The first three methods are discontiuous. The following discontinuous |
| 5347 | variations of the default "linear" (7.) option are also available: |
| 5348 | |
| 5349 | * "lower" |
| 5350 | * "higher" |
| 5351 | * "midpoint" |
| 5352 | * "nearest" |
| 5353 | |
| 5354 | See :py:func:`numpy.quantile` or [1]_ for details. The "method" argument |
| 5355 | was previously called "interpolation", renamed in accordance with numpy |
| 5356 | version 1.22.0. |
| 5357 | |
| 5358 | keep_attrs : bool or None, optional |
| 5359 | If True, the dataset's attributes (`attrs`) will be copied from |
| 5360 | the original object to the new one. If False (default), the new |
| 5361 | object will be returned without attributes. |
| 5362 | skipna : bool or None, optional |
| 5363 | If True, skip missing values (as marked by NaN). By default, only |
| 5364 | skips missing values for float dtypes; other dtypes either do not |
| 5365 | have a sentinel missing value (int) or skipna=True has not been |
| 5366 | implemented (object, datetime64 or timedelta64). |
| 5367 | |
| 5368 | Returns |