@@ -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