diff --git a/pandas/tests/reshape/test_cut.py b/pandas/tests/reshape/test_cut.py index c221a3a18911e..1425686f027e4 100644 --- a/pandas/tests/reshape/test_cut.py +++ b/pandas/tests/reshape/test_cut.py @@ -725,3 +725,12 @@ def test_cut_with_nonexact_categorical_indices(): ) tm.assert_frame_equal(expected, result) + + +def test_cut_with_timestamp_tuple_labels(): + # GH 40661 + labels = [(Timestamp(10),), (Timestamp(20),), (Timestamp(30),)] + result = cut([2, 4, 6], bins=[1, 3, 5, 7], labels=labels) + + expected = Categorical.from_codes([0, 1, 2], labels, ordered=True) + tm.assert_categorical_equal(result, expected)