File tree 3 files changed +14
-2
lines changed
3 files changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -782,11 +782,16 @@ Build Changes
782
782
783
783
- Fix install error with PyPy on macOS (:issue: `26536 `)
784
784
785
+ ExtensionArray
786
+ ^^^^^^^^^^^^^^
787
+
788
+ - Bug in :func: `factorize ` when passing an ``ExtensionArray `` with a custom ``na_sentinel `` (:issue: `25696 `).
789
+ - :meth: `Series.count ` miscounts NA values in ExtensionArrays (:issue: `26835 `)
790
+
785
791
Other
786
792
^^^^^
787
793
788
794
- Removed unused C functions from vendored UltraJSON implementation (:issue: `26198 `)
789
- - Bug in :func: `factorize ` when passing an ``ExtensionArray `` with a custom ``na_sentinel `` (:issue: `25696 `).
790
795
- Allow :class: `Index ` and :class: `RangeIndex ` to be passed to numpy ``min `` and ``max `` functions (:issue: `26125 `)
791
796
792
797
.. _whatsnew_0.250.contributors :
Original file line number Diff line number Diff line change @@ -1659,7 +1659,7 @@ def count(self, level=None):
1659
1659
2
1660
1660
"""
1661
1661
if level is None :
1662
- return notna (com . values_from_object ( self ) ).sum ()
1662
+ return notna (self . array ).sum ()
1663
1663
1664
1664
if isinstance (level , str ):
1665
1665
level = self .index ._get_level_number (level )
Original file line number Diff line number Diff line change @@ -30,6 +30,13 @@ def test_count(self, data_missing):
30
30
expected = pd .Series ([0 , 1 ])
31
31
self .assert_series_equal (result , expected )
32
32
33
+ def test_series_count (self , data_missing ):
34
+ # GH#26835
35
+ ser = pd .Series (data_missing )
36
+ result = ser .count ()
37
+ expected = 1
38
+ assert result == expected
39
+
33
40
def test_apply_simple_series (self , data ):
34
41
result = pd .Series (data ).apply (id )
35
42
assert isinstance (result , pd .Series )
You can’t perform that action at this time.
0 commit comments