def test_sem(self, datetime_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()
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)
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)
def sem( self, *, axis=None, dtype=None, out=None, ddof=1, keepdims=False, skipna=True ): nv.validate_stat_ddof_func( (), {"dtype": dtype, "out": out, "keepdims": keepdims}, fname="sem" ) result = nanops.nansem(self._ndarray, axis=axis, skipna=skipna, ddof=ddof) return self._wrap_reduction_result(axis, result)