本文整理汇总了Python中pandas.core.nanops.nanany方法的典型用法代码示例。如果您正苦于以下问题:Python nanops.nanany方法的具体用法?Python nanops.nanany怎么用?Python nanops.nanany使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类pandas.core.nanops
的用法示例。
在下文中一共展示了nanops.nanany方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_all_any
# 需要导入模块: from pandas.core import nanops [as 别名]
# 或者: from pandas.core.nanops import nanany [as 别名]
def test_all_any(self):
assert (self.panel.all(axis=0).values == nanall(
self.panel, axis=0)).all()
assert (self.panel.all(axis=1).values == nanall(
self.panel, axis=1).T).all()
assert (self.panel.all(axis=2).values == nanall(
self.panel, axis=2).T).all()
assert (self.panel.any(axis=0).values == nanany(
self.panel, axis=0)).all()
assert (self.panel.any(axis=1).values == nanany(
self.panel, axis=1).T).all()
assert (self.panel.any(axis=2).values == nanany(
self.panel, axis=2).T).all()
示例2: test_nanany
# 需要导入模块: from pandas.core import nanops [as 别名]
# 或者: from pandas.core.nanops import nanany [as 别名]
def test_nanany(self):
self.check_funs(nanops.nanany, np.any, allow_all_nan=False,
allow_str=False, allow_date=False, allow_tdelta=False)
示例3: any
# 需要导入模块: from pandas.core import nanops [as 别名]
# 或者: from pandas.core.nanops import nanany [as 别名]
def any(self, axis=None, out=None, keepdims=False, skipna=True):
nv.validate_any((), dict(out=out, keepdims=keepdims))
return nanops.nanany(self._ndarray, axis=axis, skipna=skipna)
示例4: any
# 需要导入模块: from pandas.core import nanops [as 别名]
# 或者: from pandas.core.nanops import nanany [as 别名]
def any(self, axis=None, bool_only=None, skipna=True, level=None,
**kwargs):
"""
Return whether any element is True over requested axis.
%(na_action)s
Parameters
----------
axis : {0, 1}
0 for row-wise, 1 for column-wise
skipna : boolean, default True
Exclude NA/null values. If an entire row/column is NA, the result
will be NA
level : int, default None
If the axis is a MultiIndex (hierarchical), count along a
particular level, collapsing into a DataFrame
bool_only : boolean, default None
Only include boolean data.
Returns
-------
any : Series (or DataFrame if level specified)
"""
if axis is None:
axis = self._stat_axis_number
if level is not None:
return self._agg_by_level('any', axis=axis, level=level,
skipna=skipna)
return self._reduce(nanops.nanany, axis=axis, skipna=skipna,
numeric_only=bool_only, filter_type='bool')