From a089484a3f5901f84cd5996b2c432cf722c85500 Mon Sep 17 00:00:00 2001 From: Luke Manley Date: Sun, 13 Aug 2023 07:02:54 -0400 Subject: [PATCH 1/2] DOC: Series.count remove mention of "level" --- pandas/core/series.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index 814a770b192bf..08606c38c77e8 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -2150,7 +2150,7 @@ def count(self): Returns ------- - int or Series (if level specified) + int Number of non-null values in the Series. See Also @@ -2163,7 +2163,7 @@ def count(self): >>> s.count() 2 """ - return notna(self._values).sum().astype("int64") + return int(notna(self._values).sum()) def mode(self, dropna: bool = True) -> Series: """ From 04a1557e414efa71ac3051708aa910abc1114641 Mon Sep 17 00:00:00 2001 From: Luke Manley Date: Sun, 13 Aug 2023 19:19:46 -0400 Subject: [PATCH 2/2] leave return type as-is --- pandas/core/series.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index 08606c38c77e8..020fadc359ebd 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -2163,7 +2163,7 @@ def count(self): >>> s.count() 2 """ - return int(notna(self._values).sum()) + return notna(self._values).sum().astype("int64") def mode(self, dropna: bool = True) -> Series: """