From 9143326cf539c364f03d7e7732b7bd7d564673e6 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Tue, 2 May 2017 14:21:32 -0500 Subject: [PATCH 1/3] DOC: start fixing warnings --- doc/source/whatsnew/v0.11.0.txt | 4 ++-- pandas/io/formats/style.py | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/source/whatsnew/v0.11.0.txt b/doc/source/whatsnew/v0.11.0.txt index ea149595e681f..657aac8917728 100644 --- a/doc/source/whatsnew/v0.11.0.txt +++ b/doc/source/whatsnew/v0.11.0.txt @@ -40,7 +40,7 @@ three types of multi-axis indexing. - A slice object with ints ``1:7`` - A boolean array - See more at :ref:`Selection by Position ` + See more at Selection by Position indexing.integer - ``.ix`` supports mixed integer and label based access. It is primarily label based, but will fallback to integer positional access. ``.ix`` is the most general and will support any of the inputs to ``.loc`` and ``.iloc``, as well as support for floating point label schemes. ``.ix`` is especially useful when dealing with mixed positional and label @@ -50,7 +50,7 @@ three types of multi-axis indexing. is interpreted as position based or label based, it's usually better to be explicit and use ``.iloc`` or ``.loc``. - See more at :ref:`Advanced Indexing ` and :ref:`Advanced Hierarchical `. + See more at Advanced Indexing and :ref:`Advanced Hierarchical `. Selection Deprecations diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index f1ff2966dca48..71c61998be092 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -982,7 +982,9 @@ def bar(self, subset=None, axis=0, color='#d65f5f', width=100, """ Color the background ``color`` proptional to the values in each column. Excludes non-numeric data by default. + .. versionadded:: 0.17.1 + Parameters ---------- subset: IndexSlice, default None From 780f454b0d80cfec97a86211a4da88719ac6e499 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Tue, 2 May 2017 15:45:14 -0500 Subject: [PATCH 2/3] DOC: Remove various warnings from doc build --- doc/source/basics.rst | 2 ++ doc/source/cookbook.rst | 3 ++- doc/source/whatsnew/v0.19.0.txt | 2 +- doc/source/whatsnew/v0.20.0.txt | 35 ++++++++++++++++++--------------- doc/source/whatsnew/v0.8.0.txt | 2 -- pandas/core/indexes/interval.py | 2 +- 6 files changed, 25 insertions(+), 21 deletions(-) diff --git a/doc/source/basics.rst b/doc/source/basics.rst index 7a056203ed447..134cc5106015b 100644 --- a/doc/source/basics.rst +++ b/doc/source/basics.rst @@ -1004,6 +1004,7 @@ Transform the entire frame. ``.transform()`` allows input functions as: a numpy function name or a user defined function. .. ipython:: python + :okwarning: tsdf.transform(np.abs) tsdf.transform('abs') @@ -1055,6 +1056,7 @@ Passing a dict of lists will generate a multi-indexed DataFrame with these selective transforms. .. ipython:: python + :okwarning: tsdf.transform({'A': np.abs, 'B': [lambda x: x+1, 'sqrt']}) diff --git a/doc/source/cookbook.rst b/doc/source/cookbook.rst index 8466b3d3c3297..62aa487069132 100644 --- a/doc/source/cookbook.rst +++ b/doc/source/cookbook.rst @@ -968,7 +968,8 @@ You can use the same approach to read all files matching a pattern. Here is an Finally, this strategy will work with the other ``pd.read_*(...)`` functions described in the :ref:`io docs`. .. ipython:: python - :supress: + :suppress: + for i in range(3): os.remove('file_{}.csv'.format(i)) diff --git a/doc/source/whatsnew/v0.19.0.txt b/doc/source/whatsnew/v0.19.0.txt index 0c9bb029b9b68..bc5e278df743f 100644 --- a/doc/source/whatsnew/v0.19.0.txt +++ b/doc/source/whatsnew/v0.19.0.txt @@ -479,7 +479,7 @@ Other enhancements df.resample('M', on='date').sum() df.resample('M', level='d').sum() -- The ``.get_credentials()`` method of ``GbqConnector`` can now first try to fetch `the application default credentials `__. See the :ref:`docs ` for more details (:issue:`13577`). +- The ``.get_credentials()`` method of ``GbqConnector`` can now first try to fetch `the application default credentials `__. See the docs for more details (:issue:`13577`). - The ``.tz_localize()`` method of ``DatetimeIndex`` and ``Timestamp`` has gained the ``errors`` keyword, so you can potentially coerce nonexistent timestamps to ``NaT``. The default behavior remains to raising a ``NonExistentTimeError`` (:issue:`13057`) - ``.to_hdf/read_hdf()`` now accept path objects (e.g. ``pathlib.Path``, ``py.path.local``) for the file path (:issue:`11773`) - The ``pd.read_csv()`` with ``engine='python'`` has gained support for the diff --git a/doc/source/whatsnew/v0.20.0.txt b/doc/source/whatsnew/v0.20.0.txt index 4882acbe820ea..230c7c0b90ac0 100644 --- a/doc/source/whatsnew/v0.20.0.txt +++ b/doc/source/whatsnew/v0.20.0.txt @@ -83,6 +83,7 @@ of all unique functions. Those that are not noted for a particular column will b The API also supports a ``.transform()`` function to provide for broadcasting results. .. ipython:: python + :okwarning: df.transform(['abs', lambda x: x - x.min()]) @@ -373,26 +374,28 @@ Experimental support has been added to export ``DataFrame.style`` formats to Exc For example, after running the following, ``styled.xlsx`` renders as below: .. ipython:: python + :okwarning: - np.random.seed(24) - df = pd.DataFrame({'A': np.linspace(1, 10, 10)}) - df = pd.concat([df, pd.DataFrame(np.random.RandomState(24).randn(10, 4), - columns=list('BCDE'))], - axis=1) - df.iloc[0, 2] = np.nan - df - styled = df.style.\ - applymap(lambda val: 'color: %s' % 'red' if val < 0 else 'black').\ - apply(lambda s: ['background-color: yellow' if v else '' - for v in s == s.max()]) - styled.to_excel('styled.xlsx', engine='openpyxl') + np.random.seed(24) + df = pd.DataFrame({'A': np.linspace(1, 10, 10)}) + df = pd.concat([df, pd.DataFrame(np.random.RandomState(24).randn(10, 4), + columns=list('BCDE'))], + axis=1) + df.iloc[0, 2] = np.nan + df + styled = df.style.\ + applymap(lambda val: 'color: %s' % 'red' if val < 0 else 'black').\ + apply(lambda s: ['background-color: yellow' if v else '' + for v in s == s.max()]) + styled.to_excel('styled.xlsx', engine='openpyxl') .. image:: _static/style-excel.png .. ipython:: python - :suppress: - import os - os.remove('styled.xlsx') + :suppress: + + import os + os.remove('styled.xlsx') See the :ref:`Style documentation ` for more detail. @@ -490,7 +493,7 @@ Other Enhancements - ``Series.interpolate()`` now supports timedelta as an index type with ``method='time'`` (:issue:`6424`) - Addition of a ``level`` keyword to ``DataFrame/Series.rename`` to rename labels in the specified level of a MultiIndex (:issue:`4160`). -- ``DataFrame.reset_index()`` will now interpret a tuple ``index.name`` as a key spanning across levels of ``columns``, if this is a ``MultiIndex`` (:issues:`16164`) +- ``DataFrame.reset_index()`` will now interpret a tuple ``index.name`` as a key spanning across levels of ``columns``, if this is a ``MultiIndex`` (:issue:`16164`) - ``Timedelta.isoformat`` method added for formatting Timedeltas as an `ISO 8601 duration`_. See the :ref:`Timedelta docs ` (:issue:`15136`) - ``.select_dtypes()`` now allows the string ``datetimetz`` to generically select datetimes with tz (:issue:`14910`) - The ``.to_latex()`` method will now accept ``multicolumn`` and ``multirow`` arguments to use the accompanying LaTeX enhancements diff --git a/doc/source/whatsnew/v0.8.0.txt b/doc/source/whatsnew/v0.8.0.txt index 4136c108fba57..b9cece752981e 100644 --- a/doc/source/whatsnew/v0.8.0.txt +++ b/doc/source/whatsnew/v0.8.0.txt @@ -168,7 +168,6 @@ New plotting methods fx['FR'].plot(style='g') - @savefig whatsnew_secondary_y.png fx['IT'].plot(style='k--', secondary_y=True) Vytautas Jancauskas, the 2012 GSOC participant, has added many new plot @@ -180,7 +179,6 @@ types. For example, ``'kde'`` is a new option: np.random.randn(1000) * 0.5 + 3))) plt.figure() s.hist(normed=True, alpha=0.2) - @savefig whatsnew_kde.png s.plot(kind='kde') See :ref:`the plotting page ` for much more. diff --git a/pandas/core/indexes/interval.py b/pandas/core/indexes/interval.py index f14e7bf6bd183..ccd0d8bee4abc 100644 --- a/pandas/core/indexes/interval.py +++ b/pandas/core/indexes/interval.py @@ -99,7 +99,7 @@ class IntervalIndex(IntervalMixin, Index): .. versionadded:: 0.20.0 - Properties + Attributes ---------- left, right : array-like (1-dimensional) Left and right bounds for each interval. From 71a465546a37682cf29fc787cc6b749d19406175 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Tue, 2 May 2017 21:01:41 -0500 Subject: [PATCH 3/3] fixup advanced --- doc/source/whatsnew/v0.11.0.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/whatsnew/v0.11.0.txt b/doc/source/whatsnew/v0.11.0.txt index 657aac8917728..ea149595e681f 100644 --- a/doc/source/whatsnew/v0.11.0.txt +++ b/doc/source/whatsnew/v0.11.0.txt @@ -40,7 +40,7 @@ three types of multi-axis indexing. - A slice object with ints ``1:7`` - A boolean array - See more at Selection by Position indexing.integer + See more at :ref:`Selection by Position ` - ``.ix`` supports mixed integer and label based access. It is primarily label based, but will fallback to integer positional access. ``.ix`` is the most general and will support any of the inputs to ``.loc`` and ``.iloc``, as well as support for floating point label schemes. ``.ix`` is especially useful when dealing with mixed positional and label @@ -50,7 +50,7 @@ three types of multi-axis indexing. is interpreted as position based or label based, it's usually better to be explicit and use ``.iloc`` or ``.loc``. - See more at Advanced Indexing and :ref:`Advanced Hierarchical `. + See more at :ref:`Advanced Indexing ` and :ref:`Advanced Hierarchical `. Selection Deprecations