Skip to content

Commit 0c4e7bb

Browse files
committed
Test added to check for empty Series
1 parent 37aba9e commit 0c4e7bb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

pandas/tests/reductions/test_reductions.py

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

691+
# Empty Mean
692+
if method == "mean":
693+
s = Series([], dtype=float)
694+
result = getattr(s, method)()
695+
assert np.isnan(result)
696+
691697
# timedelta64[ns]
692698
tdser = Series([], dtype="m8[ns]")
693699
if method == "var":

0 commit comments

Comments
 (0)