Skip to content

Commit 3095889

Browse files
committed
docstring keepdims
1 parent 7a7934c commit 3095889

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

src/array_api_extra/_delegation.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ def quantile(
256256
/,
257257
*,
258258
axis: int | None = None,
259-
keepdims: bool = None, # noqa: RUF013
259+
keepdims: bool | None = None,
260260
method: str = "linear",
261261
xp: ModuleType | None = None,
262262
) -> Array:
@@ -274,10 +274,14 @@ def quantile(
274274
axis : int or None, default: None
275275
Axis along which the quantiles are computed. ``None`` ravels both `x`
276276
and `q` before performing the calculation.
277-
keepdims : bool, optional
278-
If this is set to True, the axes which are reduced are left in the
277+
keepdims : bool or None, default: None
278+
By default, the axis will be reduced away if possible
279+
(i.e. if there is exactly one element of `q` per axis-slice of `x`).
280+
If `keepdims` is set to True, the axes which are reduced are left in the
279281
result as dimensions with size one. With this option, the result will
280282
broadcast correctly against the original array `x`.
283+
If `keepdims` is set to False, the axis will be reduced away if possible,
284+
and an error will be raised otherwise.
281285
method : str, default: 'linear'
282286
The method to use for estimating the quantile. The available options are:
283287
'inverted_cdf', 'averaged_inverted_cdf', 'closest_observation',

0 commit comments

Comments
 (0)