本文整理汇总了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)])