當前位置: 首頁>>代碼示例>>Python>>正文


Python nanops.nansem方法代碼示例

本文整理匯總了Python中pandas.core.nanops.nansem方法的典型用法代碼示例。如果您正苦於以下問題:Python nanops.nansem方法的具體用法?Python nanops.nansem怎麽用?Python nanops.nansem使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pandas.core.nanops的用法示例。


在下文中一共展示了nanops.nansem方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: test_sem

# 需要導入模塊: from pandas.core import nanops [as 別名]
# 或者: from pandas.core.nanops import nansem [as 別名]
def test_sem(self, float_frame_with_na, datetime_frame,
                 float_frame, float_string_frame):
        alt = lambda x: np.std(x, ddof=1) / np.sqrt(len(x))
        assert_stat_op_calc('sem', alt, float_frame_with_na)
        assert_stat_op_api('sem', float_frame, float_string_frame)

        result = datetime_frame.sem(ddof=4)
        expected = datetime_frame.apply(
            lambda x: x.std(ddof=4) / np.sqrt(len(x)))
        tm.assert_almost_equal(result, expected)

        arr = np.repeat(np.random.random((1, 1000)), 1000, 0)
        result = nanops.nansem(arr, axis=0)
        assert not (result < 0).any()

        with pd.option_context('use_bottleneck', False):
            result = nanops.nansem(arr, axis=0)
            assert not (result < 0).any() 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:20,代碼來源:test_analytics.py

示例2: test_sem

# 需要導入模塊: from pandas.core import nanops [as 別名]
# 或者: from pandas.core.nanops import nansem [as 別名]
def test_sem(self):
        alt = lambda x: np.std(x, ddof=1) / np.sqrt(len(x))
        self._check_stat_op('sem', alt)

        result = self.tsframe.sem(ddof=4)
        expected = self.tsframe.apply(
            lambda x: x.std(ddof=4) / np.sqrt(len(x)))
        tm.assert_almost_equal(result, expected)

        arr = np.repeat(np.random.random((1, 1000)), 1000, 0)
        result = nanops.nansem(arr, axis=0)
        assert not (result < 0).any()

        with pd.option_context('use_bottleneck', False):
            result = nanops.nansem(arr, axis=0)
            assert not (result < 0).any() 
開發者ID:birforce,項目名稱:vnpy_crypto,代碼行數:18,代碼來源:test_analytics.py

示例3: test_nansem

# 需要導入模塊: from pandas.core import nanops [as 別名]
# 或者: from pandas.core.nanops import nansem [as 別名]
def test_nansem(self, ddof):
        from scipy.stats import sem
        with np.errstate(invalid='ignore'):
            self.check_funs(nanops.nansem, sem, allow_complex=False,
                            allow_str=False, allow_date=False,
                            allow_tdelta=False, allow_obj='convert', ddof=ddof) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:8,代碼來源:test_nanops.py

示例4: sem

# 需要導入模塊: from pandas.core import nanops [as 別名]
# 或者: from pandas.core.nanops import nansem [as 別名]
def sem(self, axis=None, dtype=None, out=None, ddof=1, keepdims=False,
            skipna=True):
        nv.validate_stat_ddof_func((), dict(dtype=dtype, out=out,
                                            keepdims=keepdims),
                                   fname='sem')
        return nanops.nansem(self._ndarray, axis=axis, skipna=skipna,
                             ddof=ddof) 
開發者ID:Frank-qlu,項目名稱:recruit,代碼行數:9,代碼來源:numpy_.py

示例5: test_nansem

# 需要導入模塊: from pandas.core import nanops [as 別名]
# 或者: from pandas.core.nanops import nansem [as 別名]
def test_nansem(self):
        tm.skip_if_no_package('scipy', min_version='0.17.0')
        from scipy.stats import sem
        with np.errstate(invalid='ignore'):
            self.check_funs_ddof(nanops.nansem, sem, allow_complex=False,
                                 allow_str=False, allow_date=False,
                                 allow_tdelta=False, allow_obj='convert') 
開發者ID:securityclippy,項目名稱:elasticintel,代碼行數:9,代碼來源:test_nanops.py


注:本文中的pandas.core.nanops.nansem方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。