added dtype, fweights, aweights args to cov
@@ -78,7 +78,8 @@ def correlate(a, v, mode='valid'):
return out
-def cov(a, y=None, rowvar=True, bias=False, ddof=None, fweights=None, aweights=None, *, dtype=None):
+def cov(a, y=None, rowvar=True, bias=False, ddof=None,
+ fweights=None, aweights=None, *, dtype=None):
"""Returns the covariance matrix of an array.
This function currently does not support ``fweights`` and ``aweights``
@@ -125,8 +126,10 @@ def cov(a, y=None, rowvar=True, bias=False, ddof=None, fweights=None, aweights=N
else:
if y.ndim > 2:
raise ValueError('y must be <= 2-d')
- dtype = functools.reduce(numpy.promote_types,
- (a.dtype, y.dtype, numpy.float64))
+ dtype = functools.reduce(
+ numpy.promote_types,
+ (a.dtype, y.dtype, numpy.float64)
+ )
X = cupy.array(a, ndmin=2, dtype=dtype)
if not rowvar and X.shape[0] != 1:
