Skip to content

Commit 946f99b

Browse files
committed
BUG: Fix value_counts() with mixed int/str indexes containing nulls
1 parent b87036f commit 946f99b

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

pandas/tests/base/test_value_counts.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ def test_value_counts_null(null_obj, index_or_series_obj):
6363
elif isinstance(orig, MultiIndex):
6464
pytest.skip(f"MultiIndex can't hold '{null_obj}'")
6565

66+
if obj.dtype == 'object':
67+
obj = obj.astype(str)
68+
69+
6670
values = obj._values
6771
values[0:2] = null_obj
6872

0 commit comments

Comments
 (0)