dpnp.average

dpnp.average(x1, axis=None, weights=None, returned=False)[source]

Compute the weighted average along the specified axis.

For full documentation refer to numpy.average.

Limitations

Input array is supported as dpnp.ndarray. Prameters axis is supported only with default value None. Prameters weights is supported only with default value None. Prameters returned 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 Data types.

See also

dpnp.mean

Compute the arithmetic mean along the specified axis.

Examples

>>> import dpnp as np
>>> data = np.arange(1, 5)
>>> [i for i in data]
[1, 2, 3, 4]
>>> np.average(data)
2.5