Can anyone else reproduce this? (python 2 only)
$ pytest pandas/tests/test_algos.py::TestUnique::test_order_of_appearance
=========================================================== test session starts ============================================================
platform darwin -- Python 2.7.14, pytest-3.3.2, py-1.5.2, pluggy-0.6.0
rootdir: /Users/taugspurger/sandbox/pandas-ip-2/pandas, inifile: setup.cfg
plugins: xdist-1.22.0, forked-0.2, hypothesis-3.38.5
collected 1 item
pandas/tests/test_algos.py F [100%]
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> traceback >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
self = <pandas.tests.test_algos.TestUnique object at 0x10e16aa90>
def test_order_of_appearance(self):
# 9346
# light testing of guarantee of order of appearance
# these also are the doc-examples
result = pd.unique(Series([2, 1, 3, 3]))
tm.assert_numpy_array_equal(result,
np.array([2, 1, 3], dtype='int64'))
result = pd.unique(Series([2] + [1] * 5))
tm.assert_numpy_array_equal(result,
np.array([2, 1], dtype='int64'))
result = pd.unique(Series([Timestamp('20160101'),
Timestamp('20160101')]))
expected = np.array(['2016-01-01T00:00:00.000000000'],
dtype='datetime64[ns]')
> tm.assert_numpy_array_equal(result, expected)
pandas/tests/test_algos.py:428:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
pandas/util/testing.py:1077: in assert_numpy_array_equal
_raise(left, right, err_msg)
pandas/util/testing.py:1071: in _raise
raise_assert_detail(obj, msg, left, right)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
obj = 'numpy array', message = 'numpy array values are different (100.0 %)', left = '[2015-12-31T18:00:00.000000000-0600]'
right = '[2016-01-01T00:00:00.000000000-0600]', diff = None
def raise_assert_detail(obj, message, left, right, diff=None):
if isinstance(left, np.ndarray):
left = pprint_thing(left)
elif is_categorical_dtype(left):
left = repr(left)
if isinstance(right, np.ndarray):
right = pprint_thing(right)
elif is_categorical_dtype(right):
right = repr(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 values are different (100.0 %)
E [left]: [2015-12-31T18:00:00.000000000-0600]
E [right]: [2016-01-01T00:00:00.000000000-0600]
pandas/util/testing.py:1008: AssertionError
Comment From: TomAugspurger
Ah, this was with NumPy 1.10.4
Comment From: gfyoung
@jreback @TomAugspurger : Given that we're moving to PY3 only, can we close this?
Comment From: jreback
yep