maxframe.dataframe.Series.nunique#

Series.nunique(dropna=True)#

返回对象中唯一元素的数量。

默认排除 NA 值。

参数:

dropna (bool, default True) -- 不包括 NaN 在计数中。

返回类型:

int

参见

DataFrame.nunique

DataFrame 的 nunique 方法。

Series.count

计算 Series 中非 NA/空值的观测数量。

示例

>>> import maxframe.dataframe as md
>>> s = md.Series([1, 3, 5, 7, 7])
>>> s.execute()
0    1
1    3
2    5
3    7
4    7
dtype: int64
>>> s.nunique().execute()
4