We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 19aa5ab commit c2188deCopy full SHA for c2188de
pandas/tests/series/methods/test_unique.py
@@ -2,7 +2,9 @@
2
3
from pandas import (
4
Categorical,
5
+ IntervalIndex,
6
Series,
7
+ date_range,
8
)
9
import pandas._testing as tm
10
@@ -56,3 +58,19 @@ def test_unique_categorical(self):
56
58
ser = Series(cat)
57
59
result = ser.unique()
60
tm.assert_categorical_equal(result, cat)
61
+
62
+ def test_tz_unique(self):
63
+ # GH 46128
64
+ dti1 = date_range("2016-01-01", periods=3)
65
+ ii1 = IntervalIndex.from_breaks(dti1)
66
+ ser1 = Series(ii1)
67
+ uni1 = ser1.unique()
68
+ tm.assert_interval_array_equal(ser1.array, uni1)
69
70
+ dti2 = date_range("2016-01-01", periods=3, tz="US/Eastern")
71
+ ii2 = IntervalIndex.from_breaks(dti2)
72
+ ser2 = Series(ii2)
73
+ uni2 = ser2.unique()
74
+ tm.assert_interval_array_equal(ser2.array, uni2)
75
76
+ assert uni1.dtype != uni2.dtype
0 commit comments