Skip to content

Commit 625617e

Browse files
committed
TST: add test case categorical vs noncategorical
1 parent 3e293cf commit 625617e

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

pandas/tests/arrays/categorical/test_missing.py

+12-3
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,19 @@ def test_use_inf_as_na_outside_context(self, values, expected):
151151

152152
def test_compare_categorical_with_missing(self):
153153
# GH 28384
154-
s1 = Series(["a", "b", np.nan], dtype="category")
155-
s2 = Series(["b", "a", "a"], dtype="category")
154+
a1 = ["a", "b", np.nan]
155+
a2 = ["b", "a", "a"]
156+
157+
cat_s1 = Series(a1, dtype="category")
158+
cat_s2 = Series(a2, dtype="category")
159+
result = cat_s1 != cat_s2
156160

157-
result = s1 != s2
158161
expected = Series([True, True, True], dtype="bool")
162+
tm.assert_series_equal(result, expected)
163+
164+
# categorical vs noncategorical
165+
noncat_s1 = Series(a1)
166+
noncat_s2 = Series(a2)
167+
expected = noncat_s1 != noncat_s2
159168

160169
tm.assert_series_equal(result, expected)

0 commit comments

Comments
 (0)