本文整理匯總了Python中pandas.core.nanops.nanmean方法的典型用法代碼示例。如果您正苦於以下問題:Python nanops.nanmean方法的具體用法?Python nanops.nanmean怎麽用?Python nanops.nanmean使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類pandas.core.nanops
的用法示例。
在下文中一共展示了nanops.nanmean方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: test_nanmean
# 需要導入模塊: from pandas.core import nanops [as 別名]
# 或者: from pandas.core.nanops import nanmean [as 別名]
def test_nanmean(self):
self.check_funs(nanops.nanmean, np.mean, allow_complex=False,
allow_obj=False, allow_str=False, allow_date=False,
allow_tdelta=True)
示例2: mean
# 需要導入模塊: from pandas.core import nanops [as 別名]
# 或者: from pandas.core.nanops import nanmean [as 別名]
def mean(self, axis=None, dtype=None, out=None, keepdims=False,
skipna=True):
nv.validate_mean((), dict(dtype=dtype, out=out, keepdims=keepdims))
return nanops.nanmean(self._ndarray, axis=axis, skipna=skipna)
示例3: seasonal_mean
# 需要導入模塊: from pandas.core import nanops [as 別名]
# 或者: from pandas.core.nanops import nanmean [as 別名]
def seasonal_mean(x, freq):
"""
Return means for each period in x. freq is an int that gives the
number of periods per cycle. E.g., 12 for monthly. NaNs are ignored
in the mean.
"""
return np.array([pd_nanmean(x[i::freq], axis=0) for i in range(freq)])
示例4: seasonal_mean
# 需要導入模塊: from pandas.core import nanops [as 別名]
# 或者: from pandas.core.nanops import nanmean [as 別名]
def seasonal_mean(x, freq):
"""
Return means for each period in x. freq is an int that gives the
number of periods per cycle. E.g., 12 for monthly. NaNs are ignored
in the mean.
"""
return np.array([pd_nanmean(x[i::freq]) for i in range(freq)])