Skip to content

Commit 24c1f37

Browse files
committed
tests on empty and nan for masked series
1 parent ce2b69c commit 24c1f37

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

pandas/tests/reductions/test_reductions.py

+10
Original file line numberDiff line numberDiff line change
@@ -689,6 +689,16 @@ def test_ops_consistency_on_empty(self, method):
689689
result = getattr(Series(dtype=float), method)()
690690
assert pd.isna(result)
691691

692+
# Nullable dtype on mean
693+
eser = Series([], dtype="Int64")
694+
nser = Series([np.nan], dtype="Int64")
695+
if method == "mean":
696+
result = getattr(eser, method)()
697+
assert pd.isna(result)
698+
699+
result = getattr(nser, method)()
700+
assert pd.isna(result)
701+
692702
# timedelta64[ns]
693703
tdser = Series([], dtype="m8[ns]")
694704
if method == "var":

0 commit comments

Comments
 (0)