dpnp.median

dpnp.median(x1, axis=None, out=None, overwrite_input=False, keepdims=False)[source]

Compute the median along the specified axis.

For full documentation refer to numpy.median.

Limitations

Input array is supported as dpnp.ndarray. Parameter axis is supported only with default value None. Parameter out is supported only with default value None. Parameter overwrite_input is supported only with default value False. Parameter keepdims is supported only with default value False. Otherwise the function will be executed sequentially on CPU. Input array data types are limited by supported DPNP Available array data types.

See also

dpnp.mean

Compute the arithmetic mean along the specified axis.

dpnp.percentile

Compute the q-th percentile of the data along the specified axis.

Examples

>>> import dpnp as np
>>> a = np.array([[10, 7, 4], [3, 2, 1]])
>>> np.median(a)
3.5