MCPcopy
hub / github.com/pandas-dev/pandas / test_unique_tuples

Method test_unique_tuples

pandas/tests/test_algos.py:1667–1681  ·  view source on GitHub ↗
(self, arr, uniques)

Source from the content-addressed store, hash-verified

1665 ],
1666 )
1667 def test_unique_tuples(self, arr, uniques):
1668 # https://github.com/pandas-dev/pandas/issues/16519
1669 expected = np.empty(len(uniques), dtype=object)
1670 expected[:] = uniques
1671
1672 msg = (
1673 r"unique requires a Series, Index, ExtensionArray, np.ndarray "
1674 r"or NumpyExtensionArray got list"
1675 )
1676 with pytest.raises(TypeError, match=msg):
1677 # GH#52986
1678 pd.unique(arr)
1679
1680 res = pd.unique(com.asarray_tuplesafe(arr, dtype=object))
1681 tm.assert_numpy_array_equal(res, expected)
1682
1683 @pytest.mark.parametrize(
1684 "array,expected",

Callers

nothing calls this directly

Calls 3

emptyMethod · 0.45
raisesMethod · 0.45
uniqueMethod · 0.45

Tested by

no test coverage detected