pandas.Series.count
- Series.count()[source]
-
Return number of non-NA/null observations in the Series.
- Returns:
-
- int
-
Number of non-null values in the Series.
See also
DataFrame.count
-
Count non-NA cells for each column or row.
Examples
>>> s = pd.Series([0.0, 1.0, np.nan]) >>> s.count() 2
© 2008–2011, AQR Capital Management, LLC, Lambda Foundry, Inc. and PyData Development Team
© 2011–2025, Open source contributors
Licensed under the 3-clause BSD License.
https://pandas.pydata.org/pandas-docs/version/2.3.0/reference/api/pandas.Series.count.html