diff --git a/RELEASE.rst b/RELEASE.rst index eaff573a7510a..4085d350f3766 100644 --- a/RELEASE.rst +++ b/RELEASE.rst @@ -103,6 +103,7 @@ pandas 0.11.1 - Fix ``.diff`` on datelike and timedelta operations (GH3100_) - ``combine_first`` not returning the same dtype in cases where it can (GH3552_) - Fixed bug with ``Panel.transpose`` argument aliases (GH3556_) + - Fixed platform bug in ``PeriodIndex.take`` (GH3579_) - Fixed bug in reset_index with ``NaN`` in a multi-index (GH3586_) .. _GH3164: https://github.com/pydata/pandas/issues/3164 @@ -143,6 +144,7 @@ pandas 0.11.1 .. _GH3562: https://github.com/pydata/pandas/issues/3562 .. _GH3586: https://github.com/pydata/pandas/issues/3586 .. _GH3493: https://github.com/pydata/pandas/issues/3493 +.. _GH3579: https://github.com/pydata/pandas/issues/3579 .. _GH3556: https://github.com/pydata/pandas/issues/3556 diff --git a/pandas/tests/test_groupby.py b/pandas/tests/test_groupby.py index 051d8c43a48a8..23077655d5144 100644 --- a/pandas/tests/test_groupby.py +++ b/pandas/tests/test_groupby.py @@ -318,6 +318,15 @@ def test_agg_period_index(self): rs = df.groupby(level=0).sum() self.assert_(isinstance(rs.index, PeriodIndex)) + # GH 3579 + index = period_range(start='1999-01', periods=5, freq='M') + s1 = Series(np.random.rand(len(index)), index=index) + s2 = Series(np.random.rand(len(index)), index=index) + series = [('s1', s1), ('s2',s2)] + df = DataFrame.from_items(series) + grouped = df.groupby(df.index.month) + list(grouped) + def test_agg_must_agg(self): grouped = self.df.groupby('A')['C'] self.assertRaises(Exception, grouped.agg, lambda x: x.describe()) diff --git a/pandas/tseries/period.py b/pandas/tseries/period.py index abb7486de9351..34c640392bda9 100644 --- a/pandas/tseries/period.py +++ b/pandas/tseries/period.py @@ -1125,6 +1125,7 @@ def take(self, indices, axis=None): """ Analogous to ndarray.take """ + indices = com._ensure_platform_int(indices) taken = self.values.take(indices, axis=axis) taken = taken.view(PeriodIndex) taken.freq = self.freq