Skip to content

Commit 600a9e3

Browse files
committed
Merge pull request #9652 from jreback/sort
COMPAT: odd arrays can be correctly ordered in newer versions of numpy
2 parents 33f238f + 56346cf commit 600a9e3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pandas/tests/test_categorical.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,11 @@ def test_constructor_unsortable(self):
8686
self.assertFalse(factor.ordered)
8787

8888
# this however will raise as cannot be sorted
89-
self.assertRaises(TypeError, lambda : Categorical.from_array(arr, ordered=True))
89+
# but fixed in newer versions of numpy
90+
if LooseVersion(np.__version__) < "1.10":
91+
self.assertRaises(TypeError, lambda : Categorical.from_array(arr, ordered=True))
92+
else:
93+
Categorical.from_array(arr, ordered=True)
9094

9195
def test_constructor(self):
9296

0 commit comments

Comments
 (0)