Skip to content

Commit d0f20f4

Browse files
committed
added testing for explicit assignment of categories in Categorical
1 parent d8bda87 commit d0f20f4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pandas/tests/reshape/test_tile.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@ def test_cut_pass_labels(self):
218218
result = cut(arr, bins, labels=Categorical.from_codes([0, 1, 2],
219219
labels))
220220
exp = Categorical.from_codes([1] + 4 * [0] + [1, 2], labels)
221+
tm.assert_categorical_equal(result, exp)
222+
223+
labels = ['Good', 'Medium', 'Bad']
224+
result = cut(arr, 3, labels=labels)
225+
exp = cut(arr, 3, labels=Categorical(labels, categories=labels, ordered=True))
221226
tm.assert_categorical_equal(result, exp)
222227

223228
def test_qcut_include_lowest(self):

0 commit comments

Comments
 (0)