modin/pandas/series.py
def cov(
        self, other, min_periods=None, ddof: Optional[int] = 1
    ):  # noqa: PR01, RT01, D200
        """
        Compute covariance with Series, excluding missing values.
        """
        this, other = self.align(other, join="inner", copy=False)
        this = self.__constructor__(this)
        other = self.__constructor__(other)
        if len(this) == 0:
            return np.nan

        if len(this) != len(other):
            raise ValueError("Operands must have same size")

        if min_periods is None:
            min_periods = 1

        valid = this.notna() & other.notna()
        if not valid.all():
            this = this[valid]
            other = other[valid]

        if len(this) < min_periods:
            return np.nan

        this = this.astype(dtype="float64")
        other = other.astype(dtype="float64")

        this -= this.mean()
        other -= other.mean()

        other = other.__constructor__(query_compiler=other._query_compiler.conj())
        result = this * other / (len(this) - ddof)
        result = result.sum()
        return result

        Compute covariance with Series, excluding missing values.
        
Compute covariance with Series, excluding missing values.
Compute covariance with Series excluding missing values .
def cov(
        self, other, min_periods=None, ddof: Optional[int] = 1
    ):  
        this, other = self.align(other, join="inner", copy=False)
        this = self.__constructor__(this)
        other = self.__constructor__(other)
        if len(this) == 0:
            return np.nan
        if len(this) != len(other):
            raise ValueError("Operands must have same size")
        if min_periods is None:
            min_periods = 1
        valid = this.notna() & other.notna()
        if not valid.all():
            this = this[valid]
            other = other[valid]
        if len(this) < min_periods:
            return np.nan
        this = this.astype(dtype="float64")
        other = other.astype(dtype="float64")
        this -= this.mean()
        other -= other.mean()
        other = other.__constructor__(query_compiler=other._query_compiler.conj())
        result = this * other / (len(this) - ddof)
        result = result.sum()
        return result
def cov ( self , other , min_periods = None , ddof : Optional [ int ] = 1 ) : this , other = self . align ( other , join = "inner" , copy = False ) this = self . __constructor__ ( this ) other = self . __constructor__ ( other ) if len ( this ) == 0 : return np . nan if len ( this ) != len ( other ) : raise ValueError ( "Operands must have same size" ) if min_periods is None : min_periods = 1 valid = this . notna ( ) & other . notna ( ) if not valid . all ( ) : this = this [ valid ] other = other [ valid ] if len ( this ) < min_periods : return np . nan this = this . astype ( dtype = "float64" ) other = other . astype ( dtype = "float64" ) this -= this . mean ( ) other -= other . mean ( ) other = other . __constructor__ ( query_compiler = other . _query_compiler . conj ( ) ) result = this * other / ( len ( this ) - ddof ) result = result . sum ( ) return result
Compute covariance with Series, excluding missing values.
Compute covariance with Series excluding missing values .
# noqa: PR01, RT01, D200 """
        Compute covariance with Series, excluding missing values.
        """
self
other
min_periods
ddof
Optional[int]