From bb06bdb63f141acd85dd83bf57dd7df1dbbec1b9 Mon Sep 17 00:00:00 2001 From: Seuss27 Date: Sun, 16 Dec 2018 10:49:39 -0500 Subject: [PATCH 01/17] DOC: Closes #24256 Fix flake8 issues in whatsnew v0.13* --- doc/source/whatsnew/v0.13.0.rst | 169 ++++++++++++++++---------------- setup.cfg | 4 - 2 files changed, 87 insertions(+), 86 deletions(-) diff --git a/doc/source/whatsnew/v0.13.0.rst b/doc/source/whatsnew/v0.13.0.rst index b11aed9284ab7..93ed486981b58 100644 --- a/doc/source/whatsnew/v0.13.0.rst +++ b/doc/source/whatsnew/v0.13.0.rst @@ -5,10 +5,6 @@ v0.13.0 (January 3, 2014) {{ header }} -.. ipython:: python - :suppress: - - from pandas import * # noqa F401, F403 This is a major release from 0.12.0 and includes a number of API changes, several new features and @@ -68,18 +64,18 @@ API changes .. code-block:: python - # previously, you would have set levels or labels directly - index.levels = [[1, 2, 3, 4], [1, 2, 4, 4]] + # previously, you would have set levels or labels directly + >>> index.levels = [[1, 2, 3, 4], [1, 2, 4, 4]] - # now, you use the set_levels or set_labels methods - index = index.set_levels([[1, 2, 3, 4], [1, 2, 4, 4]]) + # now, you use the set_levels or set_labels methods + >>> index = index.set_levels([[1, 2, 3, 4], [1, 2, 4, 4]]) - # similarly, for names, you can rename the object - # but setting names is not deprecated - index = index.set_names(["bob", "cranberry"]) + # similarly, for names, you can rename the object + # but setting names is not deprecated + >>> index = index.set_names(["bob", "cranberry"]) - # and all methods take an inplace kwarg - but return None - index.set_names(["bob", "cranberry"], inplace=True) + # and all methods take an inplace kwarg - but return None + >>> index.set_names(["bob", "cranberry"], inplace=True) - **All** division with ``NDFrame`` objects is now *truedivision*, regardless of the future import. This means that operating on pandas objects will by default @@ -109,7 +105,7 @@ API changes .. code-block:: ipython - In [7]: pd.Series(arr) / pd.Series(arr2) # no future import required + In [7]: pd.Series(arr) / pd.Series(arr2) # no future import required Out[7]: 0 0.200000 1 0.666667 @@ -125,10 +121,18 @@ API changes .. code-block:: python - if df: - .... - df1 and df2 - s1 and s2 + >>> if df: # noqa: E999, E225 + ... + ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, + a.bool(), a.item(), a.any() or a.all(). + + >>> df1 and df2 # noqa: E225 + ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, + a.bool(), a.item(), a.any() or a.all(). + + >>> s1 and s2 # noqa: E225 + ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, + a.bool(), a.item(), a.any() or a.all(). Added the ``.bool()`` method to ``NDFrame`` objects to facilitate evaluating of single-element boolean Series: @@ -151,8 +155,8 @@ API changes .. ipython:: python - dfc = DataFrame({'A':['aaa','bbb','ccc'],'B':[1,2,3]}) - pd.set_option('chained_assignment','warn') + dfc = DataFrame({'A': ['aaa', 'bbb', 'ccc'], 'B': [1, 2, 3]}) + pd.set_option('chained_assignment', 'warn') The following warning / exception will show if this is attempted. @@ -173,7 +177,7 @@ API changes .. ipython:: python - dfc.loc[0,'A'] = 11 + dfc.loc[0, 'A'] = 11 dfc - ``Panel.reindex`` has the following call signature ``Panel.reindex(items=None, major_axis=None, minor_axis=None, **kwargs)`` @@ -223,22 +227,22 @@ In the ``Series`` case this is effectively an appending operation .. ipython:: python - s = Series([1,2,3]) + s = Series([1, 2, 3]) s s[5] = 5. s .. ipython:: python - dfi = DataFrame(np.arange(6).reshape(3,2), - columns=['A','B']) + dfi = DataFrame(np.arange(6).reshape(3, 2), + columns=['A', 'B']) dfi This would previously ``KeyError`` .. ipython:: python - dfi.loc[:,'C'] = dfi.loc[:,'A'] + dfi.loc[:, 'C'] = dfi.loc[:, 'A'] dfi This is like an ``append`` operation. @@ -252,14 +256,14 @@ A Panel setting operation on an arbitrary axis aligns the input to the Panel .. ipython:: python - p = pd.Panel(np.arange(16).reshape(2,4,2), - items=['Item1','Item2'], - major_axis=pd.date_range('2001/1/12',periods=4), - minor_axis=['A','B'],dtype='float64') + p = pd.Panel(np.arange(16).reshape(2, 4, 2), + items=['Item1', 'Item2'], + major_axis=pd.date_range('2001/1/12', periods=4), + minor_axis=['A', 'B'], dtype='float64') p - p.loc[:,:,'C'] = Series([30,32],index=p.items) + p.loc[:, :, 'C'] = Series([30, 32], index=p.items) p - p.loc[:,:,'C'] + p.loc[:, :, 'C'] Float64Index API Change ~~~~~~~~~~~~~~~~~~~~~~~ @@ -274,7 +278,7 @@ Float64Index API Change index = Index([1.5, 2, 3, 4.5, 5]) index - s = Series(range(5),index=index) + s = Series(range(5), index=index) s Scalar selection for ``[],.ix,.loc`` will always be label based. An integer will match an equal float index (e.g. ``3`` is equivalent to ``3.0``) @@ -333,24 +337,24 @@ HDFStore API Changes .. ipython:: python path = 'test.h5' - dfq = DataFrame(randn(10,4), - columns=list('ABCD'), - index=date_range('20130101',periods=10)) - dfq.to_hdf(path,'dfq',format='table',data_columns=True) + dfq = DataFrame(randn(10, 4), + columns=list('ABCD'), + index=date_range('20130101', periods=10)) + dfq.to_hdf(path, 'dfq', format='table', data_columns=True) Use boolean expressions, with in-line function evaluation. .. ipython:: python - read_hdf(path,'dfq', - where="index>Timestamp('20130104') & columns=['A', 'B']") + read_hdf(path, 'dfq', + where="index>Timestamp('20130104') & columns=['A', 'B']") Use an inline column reference .. ipython:: python - read_hdf(path,'dfq', - where="A>0 or C>0") + read_hdf(path, 'dfq', + where="A>0 or C>0") .. ipython:: python :suppress: @@ -365,12 +369,12 @@ HDFStore API Changes .. ipython:: python path = 'test.h5' - df = pd.DataFrame(np.random.randn(10,2)) - df.to_hdf(path,'df_table',format='table') - df.to_hdf(path,'df_table2',append=True) - df.to_hdf(path,'df_fixed') + df = pd.DataFrame(np.random.randn(10, 2)) + df.to_hdf(path, 'df_table', format='table') + df.to_hdf(path, 'df_table2', append=True) + df.to_hdf(path, 'df_fixed') with pd.HDFStore(path) as store: - print(store) + print(store) .. ipython:: python :suppress: @@ -394,11 +398,11 @@ HDFStore API Changes .. ipython:: python path = 'test.h5' - df = DataFrame(randn(10,2)) + df = DataFrame(randn(10, 2)) store1 = HDFStore(path) store2 = HDFStore(path) - store1.append('df',df) - store2.append('df2',df) + store1.append('df', df) + store2.append('df2', df) store1 store2 @@ -479,9 +483,9 @@ Enhancements to_timedelta('1 days 06:05:01.00003') to_timedelta('15.5us') - to_timedelta(['1 days 06:05:01.00003','15.5us','nan']) - to_timedelta(np.arange(5),unit='s') - to_timedelta(np.arange(5),unit='d') + to_timedelta(['1 days 06:05:01.00003', '15.5us', 'nan']) + to_timedelta(np.arange(5), unit='s') + to_timedelta(np.arange(5), unit='d') A Series of dtype ``timedelta64[ns]`` can now be divided by another ``timedelta64[ns]`` object, or astyped to yield a ``float64`` dtyped Series. This @@ -490,17 +494,18 @@ Enhancements .. ipython:: python from datetime import timedelta - td = Series(date_range('20130101',periods=4))-Series(date_range('20121201',periods=4)) - td[2] += np.timedelta64(timedelta(minutes=5,seconds=3)) + td = Series(date_range('20130101', periods=4)) - Series( + date_range('20121201', periods=4)) + td[2] += np.timedelta64(timedelta(minutes=5, seconds=3)) td[3] = np.nan td # to days - td / np.timedelta64(1,'D') + td / np.timedelta64(1, 'D') td.astype('timedelta64[D]') # to seconds - td / np.timedelta64(1,'s') + td / np.timedelta64(1, 's') td.astype('timedelta64[s]') Dividing or multiplying a ``timedelta64[ns]`` Series by an integer or integer Series @@ -508,7 +513,7 @@ Enhancements .. ipython:: python td * -1 - td * Series([1,2,3,4]) + td * Series([1, 2, 3, 4]) Absolute ``DateOffset`` objects can act equivalently to ``timedeltas`` @@ -522,7 +527,7 @@ Enhancements .. ipython:: python td.fillna(0) - td.fillna(timedelta(days=1,seconds=5)) + td.fillna(timedelta(days=1, seconds=5)) You can do numeric reduction operations on timedeltas. @@ -544,7 +549,7 @@ Enhancements .. ipython:: python :okwarning: - Series(['a1', 'b2', 'c3']).str.extract('[ab](\d)') + Series(['a1', 'b2', 'c3']).str.extract('[ab](\\d)') Elements that do not match return ``NaN``. Extracting a regular expression with more than one group returns a DataFrame with one column per group. @@ -553,7 +558,7 @@ Enhancements .. ipython:: python :okwarning: - Series(['a1', 'b2', 'c3']).str.extract('([ab])(\d)') + Series(['a1', 'b2', 'c3']).str.extract('([ab])(\\d)') Elements that do not match return a row of ``NaN``. Thus, a Series of messy strings can be *converted* into a @@ -566,7 +571,7 @@ Enhancements :okwarning: Series(['a1', 'b2', 'c3']).str.extract( - '(?P[ab])(?P\d)') + '(?P[ab])(?P\\d)') and optional groups can also be used. @@ -574,7 +579,7 @@ Enhancements :okwarning: Series(['a1', 'b2', '3']).str.extract( - '(?P[ab])?(?P\d)') + '(?P[ab])?(?P\\d)') - ``read_stata`` now accepts Stata 13 format (:issue:`4291`) @@ -731,14 +736,14 @@ Experimental :suppress: try: - del a + del a except NameError: - pass + pass try: - del b + del b except NameError: - pass + pass .. ipython:: python @@ -753,19 +758,19 @@ Experimental :suppress: try: - del a + del a except NameError: - pass + pass try: - del b + del b except NameError: - pass + pass try: - del c + del c except NameError: - pass + pass .. ipython:: python @@ -785,11 +790,11 @@ Experimental .. ipython:: python - df = DataFrame(np.random.rand(5,2),columns=list('AB')) + df = DataFrame(np.random.rand(5, 2), columns=list('AB')) df.to_msgpack('foo.msg') pd.read_msgpack('foo.msg') - s = Series(np.random.rand(5),index=date_range('20130101',periods=5)) + s = Series(np.random.rand(5), index=date_range('20130101', periods=5)) pd.to_msgpack('foo.msg', df, s) pd.read_msgpack('foo.msg') @@ -797,8 +802,8 @@ Experimental .. ipython:: python - for o in pd.read_msgpack('foo.msg',iterator=True): - print(o) + for o in pd.read_msgpack('foo.msg', iterator=True): + print(o) .. ipython:: python :suppress: @@ -834,13 +839,13 @@ Experimental # https://console.developers.google.com/iam-admin/projects?authuser=0 projectid = xxxxxxxxx; - df = gbq.read_gbq(query, project_id = projectid) + df = gbq.read_gbq(query, project_id=projectid) # Use pandas to process and reshape the dataset df2 = df.pivot(index='STATION', columns='MONTH', values='MEAN_TEMP') df3 = pandas.concat([df2.min(), df2.mean(), df2.max()], - axis=1,keys=["Min Tem", "Mean Temp", "Max Temp"]) + axis=1, keys=["Min Tem", "Mean Temp", "Max Temp"]) The resulting DataFrame is:: @@ -889,7 +894,7 @@ to unify methods and behaviors. Series formerly subclassed directly from .. ipython:: python - s = Series([1,2,3,4]) + s = Series([1, 2, 3, 4]) Numpy Usage @@ -897,15 +902,15 @@ to unify methods and behaviors. Series formerly subclassed directly from np.ones_like(s) np.diff(s) - np.where(s>1,s,np.nan) + np.where(s > 1, s, np.nan) Pandonic Usage .. ipython:: python - Series(1,index=s.index) + Series(1, index=s.index) s.diff() - s.where(s>1) + s.where(s > 1) - Passing a ``Series`` directly to a cython function expecting an ``ndarray`` type will no long work directly, you must pass ``Series.values``, See :ref:`Enhancing Performance` @@ -979,7 +984,7 @@ to unify methods and behaviors. Series formerly subclassed directly from .. ipython:: python - s = Series([1,2,3],index=list('abc')) + s = Series([1, 2, 3], index=list('abc')) s.b s.a = 5 s diff --git a/setup.cfg b/setup.cfg index 30b4d13bd0a66..a401d11e11e41 100644 --- a/setup.cfg +++ b/setup.cfg @@ -54,10 +54,6 @@ exclude = doc/source/whatsnew/v0.10.1.rst doc/source/whatsnew/v0.11.0.rst doc/source/whatsnew/v0.12.0.rst - doc/source/whatsnew/v0.13.0.rst - doc/source/whatsnew/v0.13.1.rst - doc/source/whatsnew/v0.14.0.rst - doc/source/whatsnew/v0.14.1.rst doc/source/whatsnew/v0.15.0.rst doc/source/whatsnew/v0.15.1.rst doc/source/whatsnew/v0.15.2.rst From 9a53a5dffe3a61b9f110e02148cd5cb39aebe629 Mon Sep 17 00:00:00 2001 From: Seuss27 Date: Sun, 16 Dec 2018 11:00:46 -0500 Subject: [PATCH 02/17] DOC: Closes #24256 Fix flake8 issues in whatsnew v0.13.* Added the setup.cfg file --- setup.cfg | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/setup.cfg b/setup.cfg index a401d11e11e41..3aa1c90046c06 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,14 +45,6 @@ ignore = E402, # module level import not at top of file E703, # statement ends with a semicolon exclude = - doc/source/whatsnew/v0.7.0.rst - doc/source/whatsnew/v0.7.3.rst - doc/source/whatsnew/v0.8.0.rst - doc/source/whatsnew/v0.9.0.rst - doc/source/whatsnew/v0.9.1.rst - doc/source/whatsnew/v0.10.0.rst - doc/source/whatsnew/v0.10.1.rst - doc/source/whatsnew/v0.11.0.rst doc/source/whatsnew/v0.12.0.rst doc/source/whatsnew/v0.15.0.rst doc/source/whatsnew/v0.15.1.rst @@ -64,19 +56,10 @@ exclude = doc/source/whatsnew/v0.17.1.rst doc/source/whatsnew/v0.18.0.rst doc/source/whatsnew/v0.18.1.rst - doc/source/whatsnew/v0.19.0.rst - doc/source/whatsnew/v0.20.0.rst - doc/source/whatsnew/v0.21.0.rst - doc/source/whatsnew/v0.23.1.rst - doc/source/whatsnew/v0.23.2.rst doc/source/basics.rst doc/source/contributing_docstring.rst doc/source/enhancingperf.rst doc/source/groupby.rst - doc/source/indexing.rst - doc/source/missing_data.rst - doc/source/options.rst - doc/source/release.rst [yapf] From fa65f1498771269952170651db967c8ea19d0b25 Mon Sep 17 00:00:00 2001 From: Seuss27 Date: Sun, 16 Dec 2018 11:44:29 -0500 Subject: [PATCH 03/17] DOC: Fixed flake8 issues in whatsnew v0.13.* #24256 Added setup.cfg --- setup.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 3aa1c90046c06..c045141ab8322 100644 --- a/setup.cfg +++ b/setup.cfg @@ -117,7 +117,7 @@ known_post_core=pandas.tseries,pandas.io,pandas.plotting sections=FUTURE,STDLIB,THIRDPARTY,PRE_CORE,DTYPES,FIRSTPARTY,POST_CORE,LOCALFOLDER known_first_party=pandas -known_third_party=Cython,numpy,python-dateutil,pytz,pyarrow,pytest +known_third_party=Cython,numpy,dateutil,python-dateutil,pytz,pyarrow,pytest multi_line_output=4 force_grid_wrap=0 combine_as_imports=True From e4a529b3e02786e6e3391fee368c803000b81332 Mon Sep 17 00:00:00 2001 From: Seuss27 Date: Sun, 16 Dec 2018 20:51:27 -0500 Subject: [PATCH 04/17] DOC: Closes #24256 Fixe flake8 issues in whatsnew v0.13.* Added the flake8-group: ignore to fix the intentional E999 errors and fixed the remaining flake8 issues in v0.13.0.rst --- doc/source/whatsnew/v0.13.0.rst | 154 ++++++++++++++++---------------- 1 file changed, 77 insertions(+), 77 deletions(-) diff --git a/doc/source/whatsnew/v0.13.0.rst b/doc/source/whatsnew/v0.13.0.rst index 93ed486981b58..52f19ec30256f 100644 --- a/doc/source/whatsnew/v0.13.0.rst +++ b/doc/source/whatsnew/v0.13.0.rst @@ -65,17 +65,17 @@ API changes .. code-block:: python # previously, you would have set levels or labels directly - >>> index.levels = [[1, 2, 3, 4], [1, 2, 4, 4]] + >>> pd.index.levels = [[1, 2, 3, 4], [1, 2, 4, 4]] # now, you use the set_levels or set_labels methods - >>> index = index.set_levels([[1, 2, 3, 4], [1, 2, 4, 4]]) + >>> index = pd.index.set_levels([[1, 2, 3, 4], [1, 2, 4, 4]]) # similarly, for names, you can rename the object # but setting names is not deprecated - >>> index = index.set_names(["bob", "cranberry"]) + >>> index = pd.index.set_names(["bob", "cranberry"]) # and all methods take an inplace kwarg - but return None - >>> index.set_names(["bob", "cranberry"], inplace=True) + >>> pd.index.set_names(["bob", "cranberry"], inplace=True) - **All** division with ``NDFrame`` objects is now *truedivision*, regardless of the future import. This means that operating on pandas objects will by default @@ -93,7 +93,7 @@ API changes In [5]: arr / arr2 Out[5]: array([0, 0, 1, 4]) - In [6]: Series(arr) // Series(arr2) + In [6]: pd.Series(arr) // pd.Series(arr2) Out[6]: 0 0 1 0 @@ -120,28 +120,29 @@ API changes This prevents doing boolean comparison on *entire* pandas objects, which is inherently ambiguous. These all will raise a ``ValueError``. .. code-block:: python + :flake8-group: Ignore # Documentation says this is necessary for mandatory E999 (if df:) - >>> if df: # noqa: E999, E225 - ... - ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, - a.bool(), a.item(), a.any() or a.all(). + >>> if df: + ... + ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, + a.bool(), a.item(), a.any() or a.all(). - >>> df1 and df2 # noqa: E225 - ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, - a.bool(), a.item(), a.any() or a.all(). + >>> df1 and df2 + ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, + a.bool(), a.item(), a.any() or a.all(). - >>> s1 and s2 # noqa: E225 - ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, - a.bool(), a.item(), a.any() or a.all(). + >>> s1 and s2 + ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, + a.bool(), a.item(), a.any() or a.all(). Added the ``.bool()`` method to ``NDFrame`` objects to facilitate evaluating of single-element boolean Series: .. ipython:: python - Series([True]).bool() - Series([False]).bool() - DataFrame([[True]]).bool() - DataFrame([[False]]).bool() + pd.Series([True]).bool() + pd.Series([False]).bool() + pd.DataFrame([[True]]).bool() + pd.DataFrame([[False]]).bool() - All non-Index NDFrames (``Series``, ``DataFrame``, ``Panel``, ``Panel4D``, ``SparsePanel``, etc.), now support the entire set of arithmetic operators @@ -155,7 +156,7 @@ API changes .. ipython:: python - dfc = DataFrame({'A': ['aaa', 'bbb', 'ccc'], 'B': [1, 2, 3]}) + dfc = pd.DataFrame({'A': ['aaa', 'bbb', 'ccc'], 'B': [1, 2, 3]}) pd.set_option('chained_assignment', 'warn') The following warning / exception will show if this is attempted. @@ -227,15 +228,15 @@ In the ``Series`` case this is effectively an appending operation .. ipython:: python - s = Series([1, 2, 3]) + s = pd.Series([1, 2, 3]) s s[5] = 5. s .. ipython:: python - dfi = DataFrame(np.arange(6).reshape(3, 2), - columns=['A', 'B']) + dfi = pd.DataFrame(np.arange(6).reshape(3, 2), + columns=['A', 'B']) dfi This would previously ``KeyError`` @@ -261,7 +262,7 @@ A Panel setting operation on an arbitrary axis aligns the input to the Panel major_axis=pd.date_range('2001/1/12', periods=4), minor_axis=['A', 'B'], dtype='float64') p - p.loc[:, :, 'C'] = Series([30, 32], index=p.items) + p.loc[:, :, 'C'] = pd.Series([30, 32], index=p.items) p p.loc[:, :, 'C'] @@ -276,9 +277,9 @@ Float64Index API Change .. ipython:: python - index = Index([1.5, 2, 3, 4.5, 5]) + index = pd.Index([1.5, 2, 3, 4.5, 5]) index - s = Series(range(5), index=index) + s = pd.Series(range(5), index=index) s Scalar selection for ``[],.ix,.loc`` will always be label based. An integer will match an equal float index (e.g. ``3`` is equivalent to ``3.0``) @@ -316,17 +317,17 @@ Float64Index API Change .. code-block:: ipython - In [1]: Series(range(5))[3.5] + In [1]: pd.Series(range(5))[3.5] TypeError: the label [3.5] is not a proper indexer for this index type (Int64Index) - In [1]: Series(range(5))[3.5:4.5] + In [1]: pd.Series(range(5))[3.5:4.5] TypeError: the slice start [3.5] is not a proper indexer for this index type (Int64Index) Using a scalar float indexer will be deprecated in a future version, but is allowed for now. .. code-block:: ipython - In [3]: Series(range(5))[3.0] + In [3]: pd.Series(range(5))[3.0] Out[3]: 3 HDFStore API Changes @@ -337,24 +338,24 @@ HDFStore API Changes .. ipython:: python path = 'test.h5' - dfq = DataFrame(randn(10, 4), - columns=list('ABCD'), - index=date_range('20130101', periods=10)) + dfq = pd.DataFrame(np.random.randn(10, 4), + columns=list('ABCD'), + index=pd.date_range('20130101', periods=10)) dfq.to_hdf(path, 'dfq', format='table', data_columns=True) Use boolean expressions, with in-line function evaluation. .. ipython:: python - read_hdf(path, 'dfq', - where="index>Timestamp('20130104') & columns=['A', 'B']") + pd.read_hdf(path, 'dfq', + where="index>Timestamp('20130104') & columns=['A', 'B']") Use an inline column reference .. ipython:: python - read_hdf(path, 'dfq', - where="A>0 or C>0") + pd.read_hdf(path, 'dfq', + where="A>0 or C>0") .. ipython:: python :suppress: @@ -398,9 +399,9 @@ HDFStore API Changes .. ipython:: python path = 'test.h5' - df = DataFrame(randn(10, 2)) - store1 = HDFStore(path) - store2 = HDFStore(path) + df = pd.DataFrame(np.random.randn(10, 2)) + store1 = pd.HDFStore(path) + store2 = pd.HDFStore(path) store1.append('df', df) store2.append('df2', df) @@ -464,10 +465,10 @@ Enhancements # previously, nan was erroneously counted as 2 here # now it is not counted at all - get_dummies([1, 2, np.nan]) + pd.get_dummies([1, 2, np.nan]) # unless requested - get_dummies([1, 2, np.nan], dummy_na=True) + pd.get_dummies([1, 2, np.nan], dummy_na=True) - ``timedelta64[ns]`` operations. See :ref:`the docs`. @@ -481,11 +482,11 @@ Enhancements .. ipython:: python - to_timedelta('1 days 06:05:01.00003') - to_timedelta('15.5us') - to_timedelta(['1 days 06:05:01.00003', '15.5us', 'nan']) - to_timedelta(np.arange(5), unit='s') - to_timedelta(np.arange(5), unit='d') + pd.to_timedelta('1 days 06:05:01.00003') + pd.to_timedelta('15.5us') + pd.to_timedelta(['1 days 06:05:01.00003', '15.5us', 'nan']) + pd.to_timedelta(np.arange(5), unit='s') + pd.to_timedelta(np.arange(5), unit='d') A Series of dtype ``timedelta64[ns]`` can now be divided by another ``timedelta64[ns]`` object, or astyped to yield a ``float64`` dtyped Series. This @@ -494,8 +495,8 @@ Enhancements .. ipython:: python from datetime import timedelta - td = Series(date_range('20130101', periods=4)) - Series( - date_range('20121201', periods=4)) + td = pd.Series(pd.date_range('20130101', periods=4)) - pd.Series( + pd.date_range('20121201', periods=4)) td[2] += np.timedelta64(timedelta(minutes=5, seconds=3)) td[3] = np.nan td @@ -513,7 +514,7 @@ Enhancements .. ipython:: python td * -1 - td * Series([1, 2, 3, 4]) + td * pd.Series([1, 2, 3, 4]) Absolute ``DateOffset`` objects can act equivalently to ``timedeltas`` @@ -549,7 +550,7 @@ Enhancements .. ipython:: python :okwarning: - Series(['a1', 'b2', 'c3']).str.extract('[ab](\\d)') + pd.Series(['a1', 'b2', 'c3']).str.extract('[ab](\\d)') Elements that do not match return ``NaN``. Extracting a regular expression with more than one group returns a DataFrame with one column per group. @@ -558,7 +559,7 @@ Enhancements .. ipython:: python :okwarning: - Series(['a1', 'b2', 'c3']).str.extract('([ab])(\\d)') + pd.Series(['a1', 'b2', 'c3']).str.extract('([ab])(\\d)') Elements that do not match return a row of ``NaN``. Thus, a Series of messy strings can be *converted* into a @@ -570,7 +571,7 @@ Enhancements .. ipython:: python :okwarning: - Series(['a1', 'b2', 'c3']).str.extract( + pd.Series(['a1', 'b2', 'c3']).str.extract( '(?P[ab])(?P\\d)') and optional groups can also be used. @@ -578,7 +579,7 @@ Enhancements .. ipython:: python :okwarning: - Series(['a1', 'b2', '3']).str.extract( + pd.Series(['a1', 'b2', '3']).str.extract( '(?P[ab])?(?P\\d)') - ``read_stata`` now accepts Stata 13 format (:issue:`4291`) @@ -598,19 +599,19 @@ Enhancements .. ipython:: python - date_range('2013-01-01', periods=5, freq='5N') + pd.date_range('2013-01-01', periods=5, freq='5N') or with frequency as offset .. ipython:: python - date_range('2013-01-01', periods=5, freq=pd.offsets.Nano(5)) + pd.date_range('2013-01-01', periods=5, freq=pd.offsets.Nano(5)) Timestamps can be modified in the nanosecond range .. ipython:: python - t = Timestamp('20130101 09:01:02') + t = pd.Timestamp('20130101 09:01:02') t + pd.tseries.offsets.Nano(123) - A new method, ``isin`` for DataFrames, which plays nicely with boolean indexing. The argument to ``isin``, what we're comparing the DataFrame to, can be a DataFrame, Series, dict, or array of values. See :ref:`the docs` for more. @@ -619,9 +620,9 @@ Enhancements .. ipython:: python - dfi = DataFrame({'A': [1, 2, 3, 4], 'B': ['a', 'b', 'f', 'n']}) + dfi = pd.DataFrame({'A': [1, 2, 3, 4], 'B': ['a', 'b', 'f', 'n']}) dfi - other = DataFrame({'A': [1, 3, 3, 7], 'B': ['e', 'f', 'f', 'e']}) + other = pd.DataFrame({'A': [1, 3, 3, 7], 'B': ['e', 'f', 'f', 'e']}) mask = dfi.isin(other) mask dfi[mask.any(1)] @@ -658,8 +659,8 @@ Enhancements .. ipython:: python - df = DataFrame({'A': [1, 2.1, np.nan, 4.7, 5.6, 6.8], - 'B': [.25, np.nan, np.nan, 4, 12.2, 14.4]}) + df = pd.DataFrame({'A': [1, 2.1, np.nan, 4.7, 5.6, 6.8], + 'B': [.25, np.nan, np.nan, 4, 12.2, 14.4]}) df.interpolate() Additionally, the ``method`` argument to ``interpolate`` has been expanded @@ -713,7 +714,7 @@ Experimental .. ipython:: python nrows, ncols = 20000, 100 - df1, df2, df3, df4 = [DataFrame(randn(nrows, ncols)) + df1, df2, df3, df4 = [pd.DataFrame(np.random.randn(nrows, ncols)) for _ in range(4)] .. ipython:: python @@ -736,18 +737,18 @@ Experimental :suppress: try: - del a + del a # noqa: F821 except NameError: pass try: - del b + del b # noqa: F821 except NameError: pass .. ipython:: python - df = DataFrame(randn(10, 2), columns=['a', 'b']) + df = pd.DataFrame(np.random.randn(10, 2), columns=['a', 'b']) df.eval('a + b') - :meth:`~pandas.DataFrame.query` method has been added that allows @@ -758,24 +759,24 @@ Experimental :suppress: try: - del a + del a # noqa: F821 except NameError: pass try: - del b + del b # noqa: F821 except NameError: pass try: - del c + del c # noqa: F821 except NameError: pass .. ipython:: python n = 20 - df = DataFrame(np.random.randint(n, size=(n, 3)), columns=['a', 'b', 'c']) + df = pd.DataFrame(np.random.randint(n, size=(n, 3)), columns=['a', 'b', 'c']) df.query('a < b < c') selects all the rows of ``df`` where ``a < b < c`` evaluates to ``True``. @@ -790,11 +791,11 @@ Experimental .. ipython:: python - df = DataFrame(np.random.rand(5, 2), columns=list('AB')) + df = pd.DataFrame(np.random.rand(5, 2), columns=list('AB')) df.to_msgpack('foo.msg') pd.read_msgpack('foo.msg') - s = Series(np.random.rand(5), index=date_range('20130101', periods=5)) + s = pd.Series(np.random.rand(5), index=pd.date_range('20130101', periods=5)) pd.to_msgpack('foo.msg', df, s) pd.read_msgpack('foo.msg') @@ -837,15 +838,14 @@ Experimental # Your Google BigQuery Project ID # To find this, see your dashboard: # https://console.developers.google.com/iam-admin/projects?authuser=0 - projectid = xxxxxxxxx; - + projectid = xxxxxxxxx; # noqa F821 df = gbq.read_gbq(query, project_id=projectid) # Use pandas to process and reshape the dataset df2 = df.pivot(index='STATION', columns='MONTH', values='MEAN_TEMP') - df3 = pandas.concat([df2.min(), df2.mean(), df2.max()], - axis=1, keys=["Min Tem", "Mean Temp", "Max Temp"]) + df3 = pd.concat([df2.min(), df2.mean(), df2.max()], + axis=1, keys=["Min Tem", "Mean Temp", "Max Temp"]) The resulting DataFrame is:: @@ -894,7 +894,7 @@ to unify methods and behaviors. Series formerly subclassed directly from .. ipython:: python - s = Series([1, 2, 3, 4]) + s = pd.Series([1, 2, 3, 4]) Numpy Usage @@ -908,7 +908,7 @@ to unify methods and behaviors. Series formerly subclassed directly from .. ipython:: python - Series(1, index=s.index) + pd.Series(1, index=s.index) s.diff() s.where(s > 1) @@ -984,7 +984,7 @@ to unify methods and behaviors. Series formerly subclassed directly from .. ipython:: python - s = Series([1, 2, 3], index=list('abc')) + s = pd.Series([1, 2, 3], index=list('abc')) s.b s.a = 5 s From b47001ba2dbe317d66f7f022b2d85d6ee823c2f4 Mon Sep 17 00:00:00 2001 From: Seuss27 Date: Mon, 17 Dec 2018 14:12:59 -0500 Subject: [PATCH 05/17] DOC: Fixes flake8 issues in whatsnew v0.13.* #24256 Corrected issues in v0.13.1.rst --- doc/source/whatsnew/v0.13.0.rst | 22 +++++------ doc/source/whatsnew/v0.13.1.rst | 68 ++++++++++++++++----------------- 2 files changed, 45 insertions(+), 45 deletions(-) diff --git a/doc/source/whatsnew/v0.13.0.rst b/doc/source/whatsnew/v0.13.0.rst index 52f19ec30256f..5815595126f02 100644 --- a/doc/source/whatsnew/v0.13.0.rst +++ b/doc/source/whatsnew/v0.13.0.rst @@ -86,20 +86,20 @@ API changes .. code-block:: ipython - In [3]: arr = np.array([1, 2, 3, 4]) + In [3]: arr = np.array([1, 2, 3, 4]) - In [4]: arr2 = np.array([5, 3, 2, 1]) + In [4]: arr2 = np.array([5, 3, 2, 1]) - In [5]: arr / arr2 - Out[5]: array([0, 0, 1, 4]) + In [5]: arr / arr2 + Out[5]: array([0, 0, 1, 4]) - In [6]: pd.Series(arr) // pd.Series(arr2) - Out[6]: - 0 0 - 1 0 - 2 1 - 3 4 - dtype: int64 + In [6]: pd.Series(arr) // pd.Series(arr2) + Out[6]: + 0 0 + 1 0 + 2 1 + 3 4 + dtype: int64 True Division diff --git a/doc/source/whatsnew/v0.13.1.rst b/doc/source/whatsnew/v0.13.1.rst index 63708e2565f4b..4bd007da7e262 100644 --- a/doc/source/whatsnew/v0.13.1.rst +++ b/doc/source/whatsnew/v0.13.1.rst @@ -5,10 +5,6 @@ v0.13.1 (February 3, 2014) {{ header }} -.. ipython:: python - :suppress: - - from pandas import * # noqa F401, F403 This is a minor release from 0.13.0 and includes a small number of API changes, several new features, @@ -35,7 +31,7 @@ Highlights include: .. ipython:: python - df = DataFrame(dict(A = np.array(['foo','bar','bah','foo','bar']))) + df = pd.DataFrame({'A': np.array(['foo', 'bar', 'bah', 'foo', 'bar'])}) df['A'].iloc[0] = np.nan df @@ -43,8 +39,8 @@ Highlights include: .. ipython:: python - df = DataFrame(dict(A = np.array(['foo','bar','bah','foo','bar']))) - df.loc[0,'A'] = np.nan + df = pd.DataFrame({'A': np.array(['foo', 'bar', 'bah', 'foo', 'bar'])}) + df.loc[0, 'A'] = np.nan df Output Formatting Enhancements @@ -58,28 +54,29 @@ Output Formatting Enhancements max_info_rows = pd.get_option('max_info_rows') - df = DataFrame(dict(A = np.random.randn(10), - B = np.random.randn(10), - C = date_range('20130101',periods=10))) - df.iloc[3:6,[0,2]] = np.nan + df = pd.DataFrame({'A': np.random.randn(10), + 'B': np.random.randn(10), + 'C': pd.date_range('20130101', periods=10) + }) + df.iloc[3:6, [0, 2]] = np.nan .. ipython:: python # set to not display the null counts - pd.set_option('max_info_rows',0) + pd.set_option('max_info_rows', 0) df.info() .. ipython:: python # this is the default (same as in 0.13.0) - pd.set_option('max_info_rows',max_info_rows) + pd.set_option('max_info_rows', max_info_rows) df.info() - Add ``show_dimensions`` display option for the new DataFrame repr to control whether the dimensions print. .. ipython:: python - df = DataFrame([[1, 2], [3, 4]]) + df = pd.DataFrame([[1, 2], [3, 4]]) pd.set_option('show_dimensions', False) df @@ -89,10 +86,13 @@ Output Formatting Enhancements - The ``ArrayFormatter`` for ``datetime`` and ``timedelta64`` now intelligently limit precision based on the values in the array (:issue:`3401`) - Previously output might look like: - - .. code-block:: python + Previously output might look like::: + >>> df = pd.DataFrame([pd.Timestamp('20010101'), + pd.Timestamp('20040601')], columns=['age']) + >>> df['today'] = pd.Timestamp('20130419') + >>> df['diff'] = df['today'] - df['age'] + >>> df age today diff 0 2001-01-01 00:00:00 2013-04-19 00:00:00 4491 days, 00:00:00 1 2004-06-01 00:00:00 2013-04-19 00:00:00 3244 days, 00:00:00 @@ -101,10 +101,10 @@ Output Formatting Enhancements .. ipython:: python - df = DataFrame([ Timestamp('20010101'), - Timestamp('20040601') ], columns=['age']) - df['today'] = Timestamp('20130419') - df['diff'] = df['today']-df['age'] + df = pd.DataFrame([pd.Timestamp('20010101'), + pd.Timestamp('20040601')], columns=['age']) + df['today'] = pd.Timestamp('20130419') + df['diff'] = df['today'] - df['age'] df API changes @@ -118,7 +118,7 @@ API changes .. ipython:: python - s = Series(['a', 'a|b', np.nan, 'a|c']) + s = pd.Series(['a', 'a|b', np.nan, 'a|c']) s.str.get_dummies(sep='|') - Added the ``NDFrame.equals()`` method to compare if two NDFrames are @@ -129,8 +129,8 @@ API changes .. code-block:: python - df = DataFrame({'col':['foo', 0, np.nan]}) - df2 = DataFrame({'col':[np.nan, 0, 'foo']}, index=[2,1,0]) + df = pd.DataFrame({'col': ['foo', 0, np.nan]}) + df2 = pd.DataFrame({'col': [np.nan, 0, 'foo']}, index=[2, 1, 0]) df.equals(df2) df.equals(df2.sort_index()) @@ -221,7 +221,7 @@ Enhancements shades = ['light', 'dark'] colors = ['red', 'green', 'blue'] - MultiIndex.from_product([shades, colors], names=['shade', 'color']) + pd.MultiIndex.from_product([shades, colors], names=['shade', 'color']) - Panel :meth:`~pandas.Panel.apply` will work on non-ufuncs. See :ref:`the docs`. @@ -255,9 +255,8 @@ Enhancements .. ipython:: python - result = panel.apply( - lambda x: (x-x.mean())/x.std(), - axis='major_axis') + result = panel.apply(lambda x: (x - x.mean()) / x.std(), + axis='major_axis') result result['ItemA'] @@ -265,20 +264,21 @@ Enhancements .. ipython:: python - f = lambda x: ((x.T-x.mean(1))/x.std(1)).T + def f(x): + return ((x.T - x.mean(1)) / x.std(1)).T - result = panel.apply(f, axis = ['items','major_axis']) + result = panel.apply(f, axis=['items', 'major_axis']) result - result.loc[:,:,'ItemA'] + result.loc[:, :, 'ItemA'] This is equivalent to the following .. ipython:: python - result = Panel(dict([ (ax,f(panel.loc[:,:,ax])) - for ax in panel.minor_axis ])) + result = pd.Panel({ax: f(panel.loc[:, :, ax]) for ax in panel.minor_axis}) + result - result.loc[:,:,'ItemA'] + result.loc[:, :, 'ItemA'] Performance ~~~~~~~~~~~ From 83aac4cb4a5bd95a2df680d9437f504a0d5c123d Mon Sep 17 00:00:00 2001 From: Seuss27 Date: Mon, 17 Dec 2018 14:19:22 -0500 Subject: [PATCH 06/17] DOC: Fixes flake8 issues in whatsnew v0.13.* #24256 Updated setup.cfg to the most recent version before PR --- setup.cfg | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index c045141ab8322..7d465eee599d7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,7 +45,6 @@ ignore = E402, # module level import not at top of file E703, # statement ends with a semicolon exclude = - doc/source/whatsnew/v0.12.0.rst doc/source/whatsnew/v0.15.0.rst doc/source/whatsnew/v0.15.1.rst doc/source/whatsnew/v0.15.2.rst @@ -117,7 +116,7 @@ known_post_core=pandas.tseries,pandas.io,pandas.plotting sections=FUTURE,STDLIB,THIRDPARTY,PRE_CORE,DTYPES,FIRSTPARTY,POST_CORE,LOCALFOLDER known_first_party=pandas -known_third_party=Cython,numpy,dateutil,python-dateutil,pytz,pyarrow,pytest +known_third_party=Cython,numpy,dateutil,matplotlib,python-dateutil,pytz,pyarrow,pytest multi_line_output=4 force_grid_wrap=0 combine_as_imports=True From ed09081d2aedc23641097c8f565ce2518945f3c7 Mon Sep 17 00:00:00 2001 From: Seuss27 Date: Mon, 17 Dec 2018 14:46:01 -0500 Subject: [PATCH 07/17] DOC: Fixes flake8 issues in whatsnew v0.13.* #24256 Added missing space in setup.cfg exclusion section. --- setup.cfg | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.cfg b/setup.cfg index 7d465eee599d7..791ee99bf85c9 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,6 +45,7 @@ ignore = E402, # module level import not at top of file E703, # statement ends with a semicolon exclude = + doc/source/whatsnew/v0.15.0.rst doc/source/whatsnew/v0.15.1.rst doc/source/whatsnew/v0.15.2.rst From 1872444c2036baea7b4bdaa52d09eb04af480d2e Mon Sep 17 00:00:00 2001 From: Seuss27 Date: Mon, 17 Dec 2018 16:27:47 -0500 Subject: [PATCH 08/17] DOC: Fixes flake8 issues in whatsnew v0.13.* #24256 One more try with setup.cfg... --- setup.cfg | 1 - 1 file changed, 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 791ee99bf85c9..7d465eee599d7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,7 +45,6 @@ ignore = E402, # module level import not at top of file E703, # statement ends with a semicolon exclude = - doc/source/whatsnew/v0.15.0.rst doc/source/whatsnew/v0.15.1.rst doc/source/whatsnew/v0.15.2.rst From 9840ea4e1514d6a845be985f1e8766b58f234ed8 Mon Sep 17 00:00:00 2001 From: Seuss27 Date: Mon, 17 Dec 2018 16:27:47 -0500 Subject: [PATCH 09/17] DOC: Fixes flake8 issues in whatsnew v0.13.* #24256 One more try with setup.cfg... --- setup.cfg | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 791ee99bf85c9..e68c14177c39a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,7 +45,8 @@ ignore = E402, # module level import not at top of file E703, # statement ends with a semicolon exclude = - + doc/source/whatsnew/v0.13.0.rst + doc/source/whatsnew/v0.13.1.rst doc/source/whatsnew/v0.15.0.rst doc/source/whatsnew/v0.15.1.rst doc/source/whatsnew/v0.15.2.rst From 4863a9664840135fb49856474dc07acdef28162a Mon Sep 17 00:00:00 2001 From: Seuss27 Date: Mon, 17 Dec 2018 21:22:36 -0500 Subject: [PATCH 10/17] DOC: Fixes flake8 issues in whatsnew v0.13.* #24256 Another attempt to get the conflicts resolved with setup.cfg Incorporated the requested changes. --- doc/source/whatsnew/v0.13.0.rst | 14 +++++++------- doc/source/whatsnew/v0.13.1.rst | 9 +++------ setup.cfg | 2 -- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/doc/source/whatsnew/v0.13.0.rst b/doc/source/whatsnew/v0.13.0.rst index 5815595126f02..38bdc781787c8 100644 --- a/doc/source/whatsnew/v0.13.0.rst +++ b/doc/source/whatsnew/v0.13.0.rst @@ -119,11 +119,11 @@ API changes This prevents doing boolean comparison on *entire* pandas objects, which is inherently ambiguous. These all will raise a ``ValueError``. - .. code-block:: python - :flake8-group: Ignore # Documentation says this is necessary for mandatory E999 (if df:) + .. code-block:: text >>> if df: - ... + pass + ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). @@ -494,10 +494,10 @@ Enhancements .. ipython:: python - from datetime import timedelta + import datetime td = pd.Series(pd.date_range('20130101', periods=4)) - pd.Series( pd.date_range('20121201', periods=4)) - td[2] += np.timedelta64(timedelta(minutes=5, seconds=3)) + td[2] += np.timedelta64(datetime.timedelta(minutes=5, seconds=3)) td[3] = np.nan td @@ -528,7 +528,7 @@ Enhancements .. ipython:: python td.fillna(0) - td.fillna(timedelta(days=1, seconds=5)) + td.fillna(datetime.timedelta(days=1, seconds=5)) You can do numeric reduction operations on timedeltas. @@ -838,7 +838,7 @@ Experimental # Your Google BigQuery Project ID # To find this, see your dashboard: # https://console.developers.google.com/iam-admin/projects?authuser=0 - projectid = xxxxxxxxx; # noqa F821 + projectid = 'xxxxxxxxx' df = gbq.read_gbq(query, project_id=projectid) # Use pandas to process and reshape the dataset diff --git a/doc/source/whatsnew/v0.13.1.rst b/doc/source/whatsnew/v0.13.1.rst index 4bd007da7e262..edc8379162c07 100644 --- a/doc/source/whatsnew/v0.13.1.rst +++ b/doc/source/whatsnew/v0.13.1.rst @@ -86,13 +86,10 @@ Output Formatting Enhancements - The ``ArrayFormatter`` for ``datetime`` and ``timedelta64`` now intelligently limit precision based on the values in the array (:issue:`3401`) - Previously output might look like::: + Previously output might look like: + + .. oode-block:: text - >>> df = pd.DataFrame([pd.Timestamp('20010101'), - pd.Timestamp('20040601')], columns=['age']) - >>> df['today'] = pd.Timestamp('20130419') - >>> df['diff'] = df['today'] - df['age'] - >>> df age today diff 0 2001-01-01 00:00:00 2013-04-19 00:00:00 4491 days, 00:00:00 1 2004-06-01 00:00:00 2013-04-19 00:00:00 3244 days, 00:00:00 diff --git a/setup.cfg b/setup.cfg index e68c14177c39a..7d465eee599d7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,8 +45,6 @@ ignore = E402, # module level import not at top of file E703, # statement ends with a semicolon exclude = - doc/source/whatsnew/v0.13.0.rst - doc/source/whatsnew/v0.13.1.rst doc/source/whatsnew/v0.15.0.rst doc/source/whatsnew/v0.15.1.rst doc/source/whatsnew/v0.15.2.rst From 75771f19ab279e1598a5255b83984cb81a892a34 Mon Sep 17 00:00:00 2001 From: Seuss27 Date: Mon, 17 Dec 2018 21:33:06 -0500 Subject: [PATCH 11/17] DOC: Fixes flake8 issues in whatsnew v0.13.* #24256 Rollback strange changes to setup.cfg and hopefully resolve the merge conflict. --- setup.cfg | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/setup.cfg b/setup.cfg index 7d465eee599d7..620824d8af20a 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,6 +45,17 @@ ignore = E402, # module level import not at top of file E703, # statement ends with a semicolon exclude = + doc/source/whatsnew/v0.7.0.rst + doc/source/whatsnew/v0.7.3.rst + doc/source/whatsnew/v0.8.0.rst + doc/source/whatsnew/v0.9.0.rst + doc/source/whatsnew/v0.9.1.rst + doc/source/whatsnew/v0.10.0.rst + doc/source/whatsnew/v0.10.1.rst + doc/source/whatsnew/v0.11.0.rst + doc/source/whatsnew/v0.12.0.rst + doc/source/whatsnew/v0.14.0.rst + doc/source/whatsnew/v0.14.1.rst doc/source/whatsnew/v0.15.0.rst doc/source/whatsnew/v0.15.1.rst doc/source/whatsnew/v0.15.2.rst @@ -59,6 +70,10 @@ exclude = doc/source/contributing_docstring.rst doc/source/enhancingperf.rst doc/source/groupby.rst + doc/source/indexing.rst + doc/source/missing_data.rst + doc/source/options.rst + doc/source/release.rst [yapf] @@ -116,7 +131,7 @@ known_post_core=pandas.tseries,pandas.io,pandas.plotting sections=FUTURE,STDLIB,THIRDPARTY,PRE_CORE,DTYPES,FIRSTPARTY,POST_CORE,LOCALFOLDER known_first_party=pandas -known_third_party=Cython,numpy,dateutil,matplotlib,python-dateutil,pytz,pyarrow,pytest +known_third_party=Cython,numpy,python-dateutil,pytz,pyarrow,pytest multi_line_output=4 force_grid_wrap=0 combine_as_imports=True From 6775fd999e895560b8161be2ff9e10f4f169cf75 Mon Sep 17 00:00:00 2001 From: Seuss27 Date: Mon, 17 Dec 2018 22:03:35 -0500 Subject: [PATCH 12/17] Revert "DOC: Closes #24256 Fix flake8 issues in whatsnew v0.13*" This reverts commit bb06bdb63f141acd85dd83bf57dd7df1dbbec1b9. --- setup.cfg | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/setup.cfg b/setup.cfg index 620824d8af20a..0ed6278bdf915 100644 --- a/setup.cfg +++ b/setup.cfg @@ -54,6 +54,11 @@ exclude = doc/source/whatsnew/v0.10.1.rst doc/source/whatsnew/v0.11.0.rst doc/source/whatsnew/v0.12.0.rst +<<<<<<< HEAD +======= + doc/source/whatsnew/v0.13.0.rst + doc/source/whatsnew/v0.13.1.rst +>>>>>>> parent of bb06bdb63... DOC: Closes #24256 Fix flake8 issues in whatsnew v0.13* doc/source/whatsnew/v0.14.0.rst doc/source/whatsnew/v0.14.1.rst doc/source/whatsnew/v0.15.0.rst From 4ac18c1982359cd28f4fa0e479e669d7e5014ea0 Mon Sep 17 00:00:00 2001 From: Seuss27 Date: Mon, 17 Dec 2018 22:19:58 -0500 Subject: [PATCH 13/17] DOC: Fixes flake8 issues in whatsnew v0.13.* #24256 Another attempt to fix the merge conflict with setup.cfg --- setup.cfg | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/setup.cfg b/setup.cfg index 0ed6278bdf915..3468dc4bb6a7d 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,7 +45,7 @@ ignore = E402, # module level import not at top of file E703, # statement ends with a semicolon exclude = - doc/source/whatsnew/v0.7.0.rst + doc/source/whatsnew/v0.7.0.rst doc/source/whatsnew/v0.7.3.rst doc/source/whatsnew/v0.8.0.rst doc/source/whatsnew/v0.9.0.rst @@ -54,11 +54,6 @@ exclude = doc/source/whatsnew/v0.10.1.rst doc/source/whatsnew/v0.11.0.rst doc/source/whatsnew/v0.12.0.rst -<<<<<<< HEAD -======= - doc/source/whatsnew/v0.13.0.rst - doc/source/whatsnew/v0.13.1.rst ->>>>>>> parent of bb06bdb63... DOC: Closes #24256 Fix flake8 issues in whatsnew v0.13* doc/source/whatsnew/v0.14.0.rst doc/source/whatsnew/v0.14.1.rst doc/source/whatsnew/v0.15.0.rst @@ -71,11 +66,16 @@ exclude = doc/source/whatsnew/v0.17.1.rst doc/source/whatsnew/v0.18.0.rst doc/source/whatsnew/v0.18.1.rst + doc/source/whatsnew/v0.19.0.rst + doc/source/whatsnew/v0.20.0.rst + doc/source/whatsnew/v0.21.0.rst + doc/source/whatsnew/v0.23.1.rst + doc/source/whatsnew/v0.23.2.rst doc/source/basics.rst doc/source/contributing_docstring.rst doc/source/enhancingperf.rst doc/source/groupby.rst - doc/source/indexing.rst + doc/source/indexing.rst doc/source/missing_data.rst doc/source/options.rst doc/source/release.rst From 70f5b2ee0c5bdf87bf4dec575b9d07c02dc983b5 Mon Sep 17 00:00:00 2001 From: Seuss27 Date: Tue, 18 Dec 2018 08:57:33 -0500 Subject: [PATCH 14/17] DOC: Fixes flake8 issues in whatsnew v0.13.* #24256 Fixed merge errors with setup.cfg, reapplying changes in this version --- setup.cfg | 2 -- 1 file changed, 2 deletions(-) diff --git a/setup.cfg b/setup.cfg index e68c14177c39a..7d465eee599d7 100644 --- a/setup.cfg +++ b/setup.cfg @@ -45,8 +45,6 @@ ignore = E402, # module level import not at top of file E703, # statement ends with a semicolon exclude = - doc/source/whatsnew/v0.13.0.rst - doc/source/whatsnew/v0.13.1.rst doc/source/whatsnew/v0.15.0.rst doc/source/whatsnew/v0.15.1.rst doc/source/whatsnew/v0.15.2.rst From 132d385b37ce8ba6c28448119f106a975914dede Mon Sep 17 00:00:00 2001 From: Seuss27 Date: Tue, 18 Dec 2018 10:29:53 -0500 Subject: [PATCH 15/17] DOC: WIP v13.0 whatsnew --- doc/source/whatsnew/v0.13.0.rst | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/doc/source/whatsnew/v0.13.0.rst b/doc/source/whatsnew/v0.13.0.rst index 38bdc781787c8..ca018254397e6 100644 --- a/doc/source/whatsnew/v0.13.0.rst +++ b/doc/source/whatsnew/v0.13.0.rst @@ -119,19 +119,22 @@ API changes This prevents doing boolean comparison on *entire* pandas objects, which is inherently ambiguous. These all will raise a ``ValueError``. - .. code-block:: text + .. code-block:: python - >>> if df: - pass + >>> if df: # noqa: F821 + ... pass + ... ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). - >>> df1 and df2 + >>> df1 and df2 # noqa: F821 + Traceback (most recent call last): + ... ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). - >>> s1 and s2 + >>> s1 and s2 # noqa: F821 ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). From 1de534bc75ec6df9c39fc134415fbb1d781f9fe7 Mon Sep 17 00:00:00 2001 From: Seuss27 Date: Tue, 18 Dec 2018 12:40:05 -0500 Subject: [PATCH 16/17] DOC: Fixes flake8 issues in whatsnew v0.13.* #24256 Implemented remaining requested changes... --- doc/source/whatsnew/v0.13.0.rst | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-) diff --git a/doc/source/whatsnew/v0.13.0.rst b/doc/source/whatsnew/v0.13.0.rst index ca018254397e6..faae9db7a8417 100644 --- a/doc/source/whatsnew/v0.13.0.rst +++ b/doc/source/whatsnew/v0.13.0.rst @@ -121,20 +121,32 @@ API changes .. code-block:: python - >>> if df: # noqa: F821 + >>> df = pd.DataFrame({'A': np.random.randn(10), + ... 'B': np.random.randn(10), + ... 'C': pd.date_range('20130101', periods=10) + ... }) + >>> if df: ... pass ... - + Traceback (most recent call last): + ... ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). - >>> df1 and df2 # noqa: F821 + >>> df1 = df + >>> df2 = df + >>> df1 and df2 Traceback (most recent call last): ... ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). - - >>> s1 and s2 # noqa: F821 + + >>> d = [1, 2, 3] + >>> s1 = pd.Series(d) + >>> s2 = pd.Series(d) + >>> s1 and s2 + Traceback (most recent call last): + ... ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). From 1a2a2254ce460c17cc8e3459eec62991f0788842 Mon Sep 17 00:00:00 2001 From: Seuss27 Date: Tue, 18 Dec 2018 12:51:20 -0500 Subject: [PATCH 17/17] DOC: Fixes flake8 issues in whatsnew v0.13.* --- doc/source/whatsnew/v0.13.0.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v0.13.0.rst b/doc/source/whatsnew/v0.13.0.rst index faae9db7a8417..7495e9fe25339 100644 --- a/doc/source/whatsnew/v0.13.0.rst +++ b/doc/source/whatsnew/v0.13.0.rst @@ -125,6 +125,7 @@ API changes ... 'B': np.random.randn(10), ... 'C': pd.date_range('20130101', periods=10) ... }) + ... >>> if df: ... pass ... @@ -140,7 +141,7 @@ API changes ... ValueError: The truth value of a DataFrame is ambiguous. Use a.empty, a.bool(), a.item(), a.any() or a.all(). - + >>> d = [1, 2, 3] >>> s1 = pd.Series(d) >>> s2 = pd.Series(d)