W3cubDocs

/pandas 0.25

pandas.Series.count

Series.count(self, level=None) [source]

Return number of non-NA/null observations in the Series.

Parameters:
level : int or level name, default None

If the axis is a MultiIndex (hierarchical), count along a particular level, collapsing into a smaller Series.

Returns:
int or Series (if level specified)

Number of non-null values in the Series.

Examples

>>> s = pd.Series([0.0, 1.0, np.nan])
>>> s.count()
2

© 2008–2012, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/0.25.0/reference/api/pandas.Series.count.html