排除 NA/null 值。如果整行/列均为 NA 且 skipna=True,则结果为 False,如同空行/列。如果 skipna=False,NA 被视为 True,因为它们不等于零。
**kwargs
any
None
其他关键字参数无实际作用,但可能为了与 NumPy 兼容而接受。
返回值
类型
描述
标量或 Series
如果指定了 level,则返回 Series;否则返回标量值。
翻译 (Translation)
Description
Series.any(*, axis=0, bool_only=False, skipna=True, **kwargs) Returns whether any element is True, potentially over an axis. Unless there is at least one element within a Series or along a DataFrame axis that is True (or equivalent, such as non-zero or non-empty), it returns False.
Parameters
Parameter
Type
Default
Description
axis
{0 or ‘index’, 1 or ‘columns’, None}
0
Specify which axis or axes should be reduced. For Series, this parameter is unused and defaults to 0.
- 0 / 'index': Reduce the index, return a Series whose index is the original column labels.
- 1 / 'columns': Reduce the columns, return a Series whose index is the original index.
- None: Reduce all axes, return a scalar.
bool_only
bool
False
Include only boolean columns. Not implemented for Series.
skipna
bool
True
Exclude NA/null values. If the entire row/column is NA and skipna=True, then the result will be False, as for an empty row/column. If skipna=False, NA are treated as True, because these are not equal to zero.
**kwargs
any
None
Additional keywords have no effect but might be accepted for compatibility with NumPy.
Returns
Type
Description
Scalar or Series
If level is specified, then a Series is returned; otherwise, a scalar is returned.