当前位置: 首页>>代码示例>>Python>>正文


Python nanops.nancov方法代码示例

本文整理汇总了Python中pandas.core.nanops.nancov方法的典型用法代码示例。如果您正苦于以下问题:Python nanops.nancov方法的具体用法?Python nanops.nancov怎么用?Python nanops.nancov使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pandas.core.nanops的用法示例。


在下文中一共展示了nanops.nancov方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: cov

# 需要导入模块: from pandas.core import nanops [as 别名]
# 或者: from pandas.core.nanops import nancov [as 别名]
def cov(self, other, min_periods=None):
        """
        Compute covariance with Series, excluding missing values.

        Parameters
        ----------
        other : Series
        min_periods : int, optional
            Minimum number of observations needed to have a valid result

        Returns
        -------
        covariance : float

        Normalized by N-1 (unbiased estimator).
        """
        this, other = self.align(other, join='inner', copy=False)
        if len(this) == 0:
            return np.nan
        return nanops.nancov(this.values, other.values,
                             min_periods=min_periods) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:23,代码来源:series.py

示例2: cov

# 需要导入模块: from pandas.core import nanops [as 别名]
# 或者: from pandas.core.nanops import nancov [as 别名]
def cov(self, other, min_periods=None):
        """
        Compute covariance with Series, excluding missing values

        Parameters
        ----------
        other : Series
        min_periods : int, optional
            Minimum number of observations needed to have a valid result

        Returns
        -------
        covariance : float

        Normalized by N-1 (unbiased estimator).
        """
        this, other = self.align(other, join='inner', copy=False)
        if len(this) == 0:
            return np.nan
        return nanops.nancov(this.values, other.values,
                             min_periods=min_periods) 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:23,代码来源:series.py

示例3: cov

# 需要导入模块: from pandas.core import nanops [as 别名]
# 或者: from pandas.core.nanops import nancov [as 别名]
def cov(self, other, min_periods=None):
        """
        Compute covariance with Series, excluding missing values

        Parameters
        ----------
        other : Series
        min_periods : int, optional
            Minimum number of observations needed to have a valid result

        Returns
        -------
        covariance : float

        Normalized by N-1 (unbiased estimator).
        """
        this, other = self.align(other, join='inner')
        if len(this) == 0:
            return pa.NA
        return nanops.nancov(this.values, other.values,
                             min_periods=min_periods) 
开发者ID:ktraunmueller,项目名称:Computable,代码行数:23,代码来源:series.py

示例4: test_nancov

# 需要导入模块: from pandas.core import nanops [as 别名]
# 或者: from pandas.core.nanops import nancov [as 别名]
def test_nancov(self):
        targ0 = np.cov(self.arr_float_2d, self.arr_float1_2d)[0, 1]
        targ1 = np.cov(self.arr_float_2d.flat, self.arr_float1_2d.flat)[0, 1]
        self.check_nancorr_nancov_2d(nanops.nancov, targ0, targ1)
        targ0 = np.cov(self.arr_float_1d, self.arr_float1_1d)[0, 1]
        targ1 = np.cov(self.arr_float_1d.flat, self.arr_float1_1d.flat)[0, 1]
        self.check_nancorr_nancov_1d(nanops.nancov, targ0, targ1) 
开发者ID:Frank-qlu,项目名称:recruit,代码行数:9,代码来源:test_nanops.py


注:本文中的pandas.core.nanops.nancov方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。