Skip to content

Commit 1770df4

Browse files
authored
TST: added test for cut when labels are tuples of Timestamps (#40661) (#43850)
1 parent 6b05ed7 commit 1770df4

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

pandas/tests/reshape/test_cut.py

+9
Original file line numberDiff line numberDiff line change
@@ -725,3 +725,12 @@ def test_cut_with_nonexact_categorical_indices():
725725
)
726726

727727
tm.assert_frame_equal(expected, result)
728+
729+
730+
def test_cut_with_timestamp_tuple_labels():
731+
# GH 40661
732+
labels = [(Timestamp(10),), (Timestamp(20),), (Timestamp(30),)]
733+
result = cut([2, 4, 6], bins=[1, 3, 5, 7], labels=labels)
734+
735+
expected = Categorical.from_codes([0, 1, 2], labels, ordered=True)
736+
tm.assert_categorical_equal(result, expected)

0 commit comments

Comments
 (0)