Skip to content

Commit

Permalink
added testing for explicit assignment of categories in Categorical
Browse files Browse the repository at this point in the history
  • Loading branch information
economy authored and TomAugspurger committed May 30, 2017
1 parent ac78a64 commit 7c20d38
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pandas/tests/reshape/test_tile.py
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,11 @@ def test_cut_pass_labels(self):
result = cut(arr, bins, labels=Categorical.from_codes([0, 1, 2],
labels))
exp = Categorical.from_codes([1] + 4 * [0] + [1, 2], labels)
tm.assert_categorical_equal(result, exp)

labels = ['Good', 'Medium', 'Bad']
result = cut(arr, 3, labels=labels)
exp = cut(arr, 3, labels=Categorical(labels, categories=labels, ordered=True))
tm.assert_categorical_equal(result, exp)

def test_qcut_include_lowest(self):
Expand Down

0 comments on commit 7c20d38

Please sign in to comment.