Repository: pandas-dev/pandas

Issue:
remove PeriodIndex.tz_convert, tz_localize?
ATM they just raise `NotImplementedError("Not yet implemented for PeriodIndex")`; if the idea of `Period` ever gaining a tz is out, these should be too.


Discussion:

Resolving patch:
diff --git a/pandas/core/indexes/period.py b/pandas/core/indexes/period.py
--- a/pandas/core/indexes/period.py
+++ b/pandas/core/indexes/period.py
@@ -140,8 +140,6 @@ class PeriodIndex(PeriodArrayMixin, DatelikeOps, DatetimeIndexOpsMixin,
     asfreq
     strftime
     to_timestamp
-    tz_convert
-    tz_localize
 
     Examples
     --------
@@ -805,50 +803,6 @@ def __setstate__(self, state):
 
     _unpickle_compat = __setstate__
 
-    def tz_convert(self, tz):
-        """
-        Convert tz-aware DatetimeIndex from one time zone to another (using
-        pytz/dateutil)
-
-        Parameters
-        ----------
-        tz : string, pytz.timezone, dateutil.tz.tzfile or None
-            Time zone for time. Corresponding timestamps would be converted to
-            time zone of the TimeSeries.
-            None will remove timezone holding UTC time.
-
-        Returns
-        -------
-        normalized : DatetimeIndex
-
-        Notes
-        -----
-        Not currently implemented for PeriodIndex
-        """
-        raise NotImplementedError("Not yet implemented for PeriodIndex")
-
-    def tz_localize(self, tz, ambiguous='raise'):
-        """
-        Localize tz-naive DatetimeIndex to given time zone (using
-        pytz/dateutil), or remove timezone from tz-aware DatetimeIndex
-
-        Parameters
-        ----------
-        tz : string, pytz.timezone, dateutil.tz.tzfile or None
-            Time zone for time. Corresponding timestamps would be converted to
-            time zone of the TimeSeries.
-            None will remove timezone holding local time.
-
-        Returns
-        -------
-        localized : DatetimeIndex
-
-        Notes
-        -----
-        Not currently implemented for PeriodIndex
-        """
-        raise NotImplementedError("Not yet implemented for PeriodIndex")
-
 
 PeriodIndex._add_comparison_methods()
 PeriodIndex._add_numeric_methods_disabled()


Test patch:
diff --git a/pandas/tests/frame/test_timeseries.py b/pandas/tests/frame/test_timeseries.py
--- a/pandas/tests/frame/test_timeseries.py
+++ b/pandas/tests/frame/test_timeseries.py
@@ -747,7 +747,6 @@ def test_datetime_assignment_with_NaT_and_diff_time_units(self):
 
     def test_frame_to_period(self):
         K = 5
-        from pandas.core.indexes.period import period_range
 
         dr = date_range('1/1/2000', '1/1/2001')
         pr = period_range('1/1/2000', '1/1/2001')
@@ -776,14 +775,6 @@ def test_frame_to_period(self):
     @pytest.mark.parametrize("fn", ['tz_localize', 'tz_convert'])
     def test_tz_convert_and_localize(self, fn):
         l0 = date_range('20140701', periods=5, freq='D')
-
-        # TODO: l1 should be a PeriodIndex for testing
-        #       after GH2106 is addressed
-        with pytest.raises(NotImplementedError):
-            period_range('20140701', periods=1).tz_convert('UTC')
-        with pytest.raises(NotImplementedError):
-            period_range('20140701', periods=1).tz_localize('UTC')
-        # l1 = period_range('20140701', periods=5, freq='D')
         l1 = date_range('20140701', periods=5, freq='D')
 
         int_idx = Index(range(5))