diff --git a/doc/source/basics.rst b/doc/source/basics.rst index 9521bae373060..638c8451bf8db 100644 --- a/doc/source/basics.rst +++ b/doc/source/basics.rst @@ -287,7 +287,7 @@ fact, this expression is False: (df+df == df*2).all() Notice that the boolean DataFrame ``df+df == df*2`` contains some False values! -That is because NaNs do not compare as equals: +That is because NaNs do not compare as equals: .. ipython:: python @@ -727,7 +727,7 @@ Apply can also accept multiple axes in the ``axis`` argument. This will pass a .. ipython:: python - f = lambda x: (x-x.mean(1)/x.std(1)) + f = lambda x: ((x.T-x.mean(1))/x.std(1)).T result = panel.apply(f, axis = ['items','major_axis']) result diff --git a/doc/source/v0.13.1.txt b/doc/source/v0.13.1.txt index 7ae80c8d36979..ded0e3b495be2 100644 --- a/doc/source/v0.13.1.txt +++ b/doc/source/v0.13.1.txt @@ -134,7 +134,7 @@ Enhancements .. ipython:: python - f = lambda x: (x-x.mean(1)/x.std(1)) + f = lambda x: ((x.T-x.mean(1))/x.std(1)).T result = panel.apply(f, axis = ['items','major_axis']) result diff --git a/pandas/io/tests/test_data.py b/pandas/io/tests/test_data.py index e6a96382cf4fd..bb442519805d4 100644 --- a/pandas/io/tests/test_data.py +++ b/pandas/io/tests/test_data.py @@ -150,12 +150,16 @@ def test_get_quote_stringlist(self): @network def test_get_components_dow_jones(self): + raise nose.SkipTest('unreliable test, receive partial components back for dow_jones') + df = web.get_components_yahoo('^DJI') #Dow Jones assert isinstance(df, pd.DataFrame) self.assertEqual(len(df), 30) @network def test_get_components_dax(self): + raise nose.SkipTest('unreliable test, receive partial components back for dax') + df = web.get_components_yahoo('^GDAXI') #DAX assert isinstance(df, pd.DataFrame) self.assertEqual(len(df), 30) @@ -166,6 +170,8 @@ def test_get_components_dax(self): def test_get_components_nasdaq_100(self): """as of 7/12/13 the conditional will test false because the link is invalid""" + raise nose.SkipTest('unreliable test, receive partial components back for nasdaq_100') + df = web.get_components_yahoo('^NDX') #NASDAQ-100 assert isinstance(df, pd.DataFrame) diff --git a/pandas/tests/test_panel.py b/pandas/tests/test_panel.py index 16a43f2f9e767..170eedd3754b3 100644 --- a/pandas/tests/test_panel.py +++ b/pandas/tests/test_panel.py @@ -1146,11 +1146,13 @@ def test_apply_slabs(self): assert_frame_equal(result,expected) # transforms - f = lambda x: (x-x.mean(1)/x.std(1)) + f = lambda x: ((x.T-x.mean(1))/x.std(1)).T - result = self.panel.apply(f, axis = ['items','major_axis']) - expected = Panel(dict([ (ax,f(self.panel.loc[:,:,ax])) for ax in self.panel.minor_axis ])) - assert_panel_equal(result,expected) + # make sure that we don't trigger any warnings + with tm.assert_produces_warning(False): + result = self.panel.apply(f, axis = ['items','major_axis']) + expected = Panel(dict([ (ax,f(self.panel.loc[:,:,ax])) for ax in self.panel.minor_axis ])) + assert_panel_equal(result,expected) result = self.panel.apply(f, axis = ['major_axis','minor_axis']) expected = Panel(dict([ (ax,f(self.panel.loc[ax])) for ax in self.panel.items ]))