Skip to content

Commit 4a504c3

Browse files
committed
categorical tests
1 parent 0ae068a commit 4a504c3

File tree

1 file changed

+2
-11
lines changed

1 file changed

+2
-11
lines changed

pandas/tests/arrays/categorical/test_api.py

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -408,19 +408,10 @@ def test_remove_unused_categories(self):
408408
[1, 1.5, "a", (1, "b"), np.nan],
409409
],
410410
)
411-
def test_to_dummies(self, vals):
411+
def test_get_dummies(self, vals):
412412
# GH 8745
413413
cats = Categorical(Series(vals))
414-
tm.assert_equal(cats.to_dummies(), get_dummies(cats).astype(bool))
415-
416-
def test_to_dummies_na_dtype(self):
417-
# when dtype of NA column name != dtype of categories,
418-
# check the cast to object
419-
# GH 8745
420-
cats = Categorical([1, 2, 2, 1, np.nan])
421-
assert cats.dtype != object
422-
dummies = cats.to_dummies(na_column="other")
423-
assert dummies.columns.categories.dtype == object
414+
tm.assert_equal(cats.get_dummies(), get_dummies(cats))
424415

425416
@pytest.mark.parametrize(
426417
"vals",

0 commit comments

Comments
 (0)