MCPcopy
hub / github.com/pydata/xarray / quantile

Method quantile

xarray/core/dataset.py:8184–8361  ·  view source on GitHub ↗

Compute the qth quantile of the data along the specified dimension. Returns the qth quantiles(s) of the array elements for each variable in the Dataset. Parameters ---------- q : float or array-like of float Quantile to compute, which must be bet

(
        self,
        q: ArrayLike,
        dim: Dims = None,
        *,
        method: QuantileMethods = "linear",
        numeric_only: bool = False,
        keep_attrs: bool | None = None,
        skipna: bool | None = None,
        interpolation: QuantileMethods | None = None,
    )

Source from the content-addressed store, hash-verified

8182 return aligned_self.isel(indices)
8183
8184 def quantile(
8185 self,
8186 q: ArrayLike,
8187 dim: Dims = None,
8188 *,
8189 method: QuantileMethods = "linear",
8190 numeric_only: bool = False,
8191 keep_attrs: bool | None = None,
8192 skipna: bool | None = None,
8193 interpolation: QuantileMethods | None = None,
8194 ) -> Self:
8195 """Compute the qth quantile of the data along the specified dimension.
8196
8197 Returns the qth quantiles(s) of the array elements for each variable
8198 in the Dataset.
8199
8200 Parameters
8201 ----------
8202 q : float or array-like of float
8203 Quantile to compute, which must be between 0 and 1 inclusive.
8204 dim : str or Iterable of Hashable, optional
8205 Dimension(s) over which to apply quantile.
8206 method : str, default: "linear"
8207 This optional parameter specifies the interpolation method to use when the
8208 desired quantile lies between two data points. The options sorted by their R
8209 type as summarized in the H&F paper [1]_ are:
8210
8211 1. "inverted_cdf"
8212 2. "averaged_inverted_cdf"
8213 3. "closest_observation"
8214 4. "interpolated_inverted_cdf"
8215 5. "hazen"
8216 6. "weibull"
8217 7. "linear" (default)
8218 8. "median_unbiased"
8219 9. "normal_unbiased"
8220
8221 The first three methods are discontiuous. The following discontinuous
8222 variations of the default "linear" (7.) option are also available:
8223
8224 * "lower"
8225 * "higher"
8226 * "midpoint"
8227 * "nearest"
8228
8229 See :py:func:`numpy.quantile` or [1]_ for details. The "method" argument
8230 was previously called "interpolation", renamed in accordance with numpy
8231 version 1.22.0.
8232
8233 keep_attrs : bool, optional
8234 If True, the dataset's attributes (`attrs`) will be copied from
8235 the original object to the new one. If False (default), the new
8236 object will be returned without attributes.
8237 numeric_only : bool, optional
8238 If True, only apply ``func`` to variables with a numeric dtype.
8239 skipna : bool, optional
8240 If True, skip missing values (as marked by NaN). By default, only
8241 skips missing values for float dtypes; other dtypes either do not

Calls 4

_get_keep_attrsFunction · 0.90
itemsMethod · 0.80
assign_coordsMethod · 0.45