dpnp.cov
- dpnp.cov(x1, y=None, rowvar=True, bias=False, ddof=None, fweights=None, aweights=None)[source]
Estimate a covariance matrix, given data and weights.
For full documentation refer to
numpy.cov.Limitations
Input array
mis supported asdpnp.ndarray. Dimension of input arraymis limited bym.ndim > 2. Size and shape of input arrays are supported to be equal. Prametersyis supported only with default valueNone. Prametersrowvaris supported only with default valueTrue. Prametersbiasis supported only with default valueFalse. Prametersddofis supported only with default valueNone. Prametersfweightsis supported only with default valueNone. Prametersaweightsis supported only with default valueNone. Otherwise the function will be executed sequentially on CPU. Input array data types are limited by supported DPNP Data types.See also
dpnp.corrcoefnormalized covariance matrix.Examples
>>> import dpnp as np >>> x = np.array([[0, 2], [1, 1], [2, 0]]).T >>> x.shape (2, 3) >>> [i for i in x] [0, 1, 2, 2, 1, 0] >>> out = np.cov(x) >>> out.shape (2, 2) >>> [i for i in out] [1.0, -1.0, -1.0, 1.0]