diff --git a/pandas/tseries/index.py b/pandas/tseries/index.py index 07dadc66cbc33..adc3fa96b1224 100644 --- a/pandas/tseries/index.py +++ b/pandas/tseries/index.py @@ -560,6 +560,9 @@ def __contains__(self, key): except (KeyError, TypeError): return False + def unique(self): + return self.asobject.unique() + def isin(self, values): """ Compute boolean array of whether each index value is found in the diff --git a/pandas/tseries/tests/test_timeseries.py b/pandas/tseries/tests/test_timeseries.py index 855bbd02489bb..4f1e93beef5f6 100644 --- a/pandas/tseries/tests/test_timeseries.py +++ b/pandas/tseries/tests/test_timeseries.py @@ -61,7 +61,8 @@ def test_is_unique_monotonic(self): def test_index_unique(self): uniques = self.dups.index.unique() - self.assert_(uniques.dtype == 'M8[ns]') # sanity + #self.assert_(uniques.dtype == 'M8[ns]') # sanity + self.assert_(isinstance(uniques[0], tslib.Timestamp)) def test_index_dupes_contains(self): d = datetime(2011, 12, 5, 20, 30)