(self, other, min_periods=None)
return hpat_pandas_series_cov_impl
Intel Scalable Dataframe Compiler User Guide
    ********************************************

    Pandas API: pandas.Series.cov

    Examples
    --------
    .. literalinclude:: ../../../examples/series/series_cov.py
       :language: python
       :lines: 27-
       :caption: Compute covariance with Series, excluding missing values.
       :name: ex_series_cov

    .. command-output:: python ./series/series_cov.py
       :cwd: ../../../examples

    .. seealso::
        :ref:`Series.corr <pandas.Series.corr>`
            Compute correlation with other Series, excluding missing values.

    Intel Scalable Dataframe Compiler Developer Guide
    *************************************************
    Pandas Series method :meth:`pandas.Series.cov` implementation.

    .. only:: developer
        Test: python -m sdc.runtests -k sdc.tests.test_series.TestSeries.test_series_cov*
Intel Scalable Dataframe Compiler User Guide
    ********************************************
Intel Scalable Dataframe Compiler User Guide ********************************************
def hpat_pandas_series_cov(self, other, min_periods=None):
    """
    Intel Scalable Dataframe Compiler User Guide
    ********************************************

    Pandas API: pandas.Series.cov

    Examples
    --------
    .. literalinclude:: ../../../examples/series/series_cov.py
       :language: python
       :lines: 27-
       :caption: Compute covariance with Series, excluding missing values.
       :name: ex_series_cov

    .. command-output:: python ./series/series_cov.py
       :cwd: ../../../examples

    .. seealso::
        :ref:`Series.corr <pandas.Series.corr>`
            Compute correlation with other Series, excluding missing values.

    Intel Scalable Dataframe Compiler Developer Guide
    *************************************************
    Pandas Series method :meth:`pandas.Series.cov` implementation.

    .. only:: developer
        Test: python -m sdc.runtests -k sdc.tests.test_series.TestSeries.test_series_cov*
    """

    ty_checker = TypeChecker('Method cov().')
    ty_checker.check(self, SeriesType)

    ty_checker.check(other, SeriesType)

    if not isinstance(self.data.dtype, types.Number):
        ty_checker.raise_exc(self.data.dtype, 'number', 'self.data')

    if not isinstance(other.data.dtype, types.Number):
        ty_checker.raise_exc(other.data.dtype, 'number', 'other.data')

    if not isinstance(min_periods, (types.Integer, types.Omitted, types.NoneType)) and min_periods is not None:
        ty_checker.raise_exc(min_periods, 'int64', 'min_periods')

    def hpat_pandas_series_cov_impl(self, other, min_periods=None):

        if min_periods is None:
            min_periods = 2

        if min_periods < 2:
            min_periods = 2

        min_len = min(len(self._data), len(other._data))

        if min_len == 0:
            return numpy.nan

        other_sum = 0.
        self_sum = 0.
        self_other_sum = 0.
        total_count = 0
        for i in prange(min_len):
            s = self._data[i]
            o = other._data[i]
            if not (numpy.isnan(s) or numpy.isnan(o)):
                self_sum += s
                other_sum += o
                self_other_sum += s*o
                total_count += 1

        if total_count < min_periods:
            return numpy.nan

        return (self_other_sum - self_sum*other_sum/total_count)/(total_count - 1)

    return hpat_pandas_series_cov_impl
def hpat_pandas_series_cov ( self , other , min_periods = None ) : ty_checker = TypeChecker ( 'Method cov().' ) ty_checker . check ( self , SeriesType ) ty_checker . check ( other , SeriesType ) if not isinstance ( self . data . dtype , types . Number ) : ty_checker . raise_exc ( self . data . dtype , 'number' , 'self.data' ) if not isinstance ( other . data . dtype , types . Number ) : ty_checker . raise_exc ( other . data . dtype , 'number' , 'other.data' ) if not isinstance ( min_periods , ( types . Integer , types . Omitted , types . NoneType ) ) and min_periods is not None : ty_checker . raise_exc ( min_periods , 'int64' , 'min_periods' ) def hpat_pandas_series_cov_impl ( self , other , min_periods = None ) : if min_periods is None : min_periods = 2 if min_periods < 2 : min_periods = 2 min_len = min ( len ( self . _data ) , len ( other . _data ) ) if min_len == 0 : return numpy . nan other_sum = 0. self_sum = 0. self_other_sum = 0. total_count = 0 for i in prange ( min_len ) : s = self . _data [ i ] o = other . _data [ i ] if not ( numpy . isnan ( s ) or numpy . isnan ( o ) ) : self_sum += s other_sum += o self_other_sum += s * o total_count += 1 if total_count < min_periods : return numpy . nan return ( self_other_sum - self_sum * other_sum / total_count ) / ( total_count - 1 ) return hpat_pandas_series_cov_impl