From 04b0f0763e7ed249f45fd207aff485487ff9a6fc Mon Sep 17 00:00:00 2001 From: jreback Date: Wed, 30 Jul 2014 12:34:40 -0400 Subject: [PATCH 1/2] PERF: groupby / frame apply optimization --- pandas/core/groupby.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/core/groupby.py b/pandas/core/groupby.py index 9659d4c3bd6e0..eabe1b43004df 100644 --- a/pandas/core/groupby.py +++ b/pandas/core/groupby.py @@ -635,11 +635,11 @@ def apply(self, func, *args, **kwargs): @wraps(func) def f(g): - # ignore SettingWithCopy here in case the user mutates - with option_context('mode.chained_assignment',None): - return func(g, *args, **kwargs) + return func(g, *args, **kwargs) - return self._python_apply_general(f) + # ignore SettingWithCopy here in case the user mutates + with option_context('mode.chained_assignment',None): + return self._python_apply_general(f) def _python_apply_general(self, f): keys, values, mutated = self.grouper.apply(f, self._selected_obj, From f6f84db25392d823c0ca4b6c3fcc34d5936f63b3 Mon Sep 17 00:00:00 2001 From: jreback Date: Wed, 30 Jul 2014 13:14:11 -0400 Subject: [PATCH 2/2] NETWORK: change failing FRED test --- pandas/io/tests/test_data.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pandas/io/tests/test_data.py b/pandas/io/tests/test_data.py index 15ebeba941ccd..e798961ea7bf9 100644 --- a/pandas/io/tests/test_data.py +++ b/pandas/io/tests/test_data.py @@ -445,7 +445,10 @@ def test_fred(self): end = datetime(2013, 1, 27) received = web.DataReader("GDP", "fred", start, end)['GDP'].tail(1)[0] - self.assertEqual(int(received), 16535) + + # < 7/30/14 16535 was returned + #self.assertEqual(int(received), 16535) + self.assertEqual(int(received), 16502) self.assertRaises(Exception, web.DataReader, "NON EXISTENT SERIES", 'fred', start, end)