Movatterモバイル変換


[0]ホーム

URL:


Skip to main content
Ctrl+K

pandas.Index.nunique#

Index.nunique(dropna=True)[source]#

Return number of unique elements in the object.

Excludes NA values by default.

Parameters:
dropnabool, default True

Don’t include NaN in the count.

Returns:
int

See also

DataFrame.nunique

Method nunique for DataFrame.

Series.count

Count non-NA/null observations in the Series.

Examples

>>>s=pd.Series([1,3,5,7,7])>>>s0    11    32    53    74    7dtype: int64
>>>s.nunique()4

[8]ページ先頭

©2009-2025 Movatter.jp