TestCategoricalIndex.test_reindexing failing on Travis / Mac build · Issue #17323 · pandas-dev/pandas (original) (raw)
Master and some PRs (strangely not all) are all failing on the same test, but only on Mac:
=================================== FAILURES ===================================
_____________________ TestCategoricalIndex.test_reindexing _____________________
[gw1] darwin -- Python 3.5.4 /Users/travis/miniconda3/envs/pandas/bin/python
self = <pandas.tests.indexes.test_category.TestCategoricalIndex object at 0x111d5e860>
def test_reindexing(self):
ci = self.create_index()
oidx = Index(np.array(ci))
for n in [1, 2, 5, len(ci)]:
finder = oidx[np.random.randint(0, len(ci), size=n)]
expected = oidx.get_indexer_non_unique(finder)[0]
actual = ci.get_indexer(finder)
> tm.assert_numpy_array_equal(expected, actual)
pandas/tests/indexes/test_category.py:389:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pandas/util/testing.py:1174: in assert_numpy_array_equal
_raise(left, right, err_msg)
pandas/util/testing.py:1157: in _raise
.format(obj=obj), left.shape, right.shape)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
obj = 'numpy array', message = 'numpy array shapes are different', left = (14,)
right = (6,), diff = None
def raise_assert_detail(obj, message, left, right, diff=None):
if isinstance(left, np.ndarray):
left = pprint_thing(left)
if isinstance(right, np.ndarray):
right = pprint_thing(right)
msg = """{obj} are different
{message}
[left]: {left}
[right]: {right}""".format(obj=obj, message=message, left=left, right=right)
if diff is not None:
msg += "\n[diff]: {diff}".format(diff=diff)
> raise AssertionError(msg)
E AssertionError: numpy array are different
E
E numpy array shapes are different
E [left]: (14,)
E [right]: (6,)
pandas/util/testing.py:1105: AssertionError