From d9d089ccc671896eba5b9c93ee355c63e9bf9c74 Mon Sep 17 00:00:00 2001 From: Oktay Sabak Date: Tue, 8 Oct 2019 11:36:41 +0300 Subject: [PATCH 01/10] fix code-block in the reshaping docs - [ x] closes #28819 --- doc/source/user_guide/reshaping.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/user_guide/reshaping.rst b/doc/source/user_guide/reshaping.rst index dd6d3062a8f0a..23ef11e3351f3 100644 --- a/doc/source/user_guide/reshaping.rst +++ b/doc/source/user_guide/reshaping.rst @@ -728,7 +728,7 @@ Suppose we wanted to pivot ``df`` such that the ``col`` values are columns, ``row`` values are the index, and the mean of ``val0`` are the values? In particular, the resulting DataFrame should look like: -.. note:: +.. code-block:: col col0 col1 col2 col3 col4 row From 0b09517c74196b5f151c429780a8e821f24ed294 Mon Sep 17 00:00:00 2001 From: Oktay Sabak Date: Tue, 8 Oct 2019 12:09:00 +0300 Subject: [PATCH 02/10] code-block selected to python if I wrote only .. code-block:: it shows in github truly but its not passing tests,. so I select python language for code-block --- doc/source/user_guide/reshaping.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/user_guide/reshaping.rst b/doc/source/user_guide/reshaping.rst index 23ef11e3351f3..f2b421f94b6df 100644 --- a/doc/source/user_guide/reshaping.rst +++ b/doc/source/user_guide/reshaping.rst @@ -728,7 +728,7 @@ Suppose we wanted to pivot ``df`` such that the ``col`` values are columns, ``row`` values are the index, and the mean of ``val0`` are the values? In particular, the resulting DataFrame should look like: -.. code-block:: +.. code-block:: python col col0 col1 col2 col3 col4 row From 07971bd94f51bb0a916c62a806ca8bc6b20238c9 Mon Sep 17 00:00:00 2001 From: Joris Van den Bossche Date: Tue, 8 Oct 2019 13:23:30 +0200 Subject: [PATCH 03/10] Update reshaping.rst --- doc/source/user_guide/reshaping.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/user_guide/reshaping.rst b/doc/source/user_guide/reshaping.rst index f2b421f94b6df..23ef11e3351f3 100644 --- a/doc/source/user_guide/reshaping.rst +++ b/doc/source/user_guide/reshaping.rst @@ -728,7 +728,7 @@ Suppose we wanted to pivot ``df`` such that the ``col`` values are columns, ``row`` values are the index, and the mean of ``val0`` are the values? In particular, the resulting DataFrame should look like: -.. code-block:: python +.. code-block:: col col0 col1 col2 col3 col4 row From dbff59d6d3d1bd6829ae8d0a6a8eb7b3ce3bdb92 Mon Sep 17 00:00:00 2001 From: Oktay Sabak Date: Tue, 8 Oct 2019 15:07:53 +0300 Subject: [PATCH 04/10] Update reshaping.rst I change the "space size before ". I hope it will pass the checks --- doc/source/user_guide/reshaping.rst | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/doc/source/user_guide/reshaping.rst b/doc/source/user_guide/reshaping.rst index 23ef11e3351f3..e36be5432601b 100644 --- a/doc/source/user_guide/reshaping.rst +++ b/doc/source/user_guide/reshaping.rst @@ -730,12 +730,12 @@ particular, the resulting DataFrame should look like: .. code-block:: - col col0 col1 col2 col3 col4 - row - row0 0.77 0.605 NaN 0.860 0.65 - row2 0.13 NaN 0.395 0.500 0.25 - row3 NaN 0.310 NaN 0.545 NaN - row4 NaN 0.100 0.395 0.760 0.24 + col col0 col1 col2 col3 col4 + row + row0 0.77 0.605 NaN 0.860 0.65 + row2 0.13 NaN 0.395 0.500 0.25 + row3 NaN 0.310 NaN 0.545 NaN + row4 NaN 0.100 0.395 0.760 0.24 This solution uses :func:`~pandas.pivot_table`. Also note that ``aggfunc='mean'`` is the default. It is included here to be explicit. From 7a8d0ba3c4f375b1826802730741cc8476a3f839 Mon Sep 17 00:00:00 2001 From: Oktay Sabak Date: Tue, 8 Oct 2019 15:50:22 +0300 Subject: [PATCH 05/10] Update reshaping.rst Finally I found the solution. `E999 SyntaxError: invalid syntax causes flake8 to skip AST tests. Keep mandatory E999 issues in blocks with :flake8-group: Ignore to preserve full testing for the rest of the blocks.` [link is here](https://pypi.org/project/flake8-rst/) --- doc/source/user_guide/reshaping.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/doc/source/user_guide/reshaping.rst b/doc/source/user_guide/reshaping.rst index e36be5432601b..63bde5a0d3d9c 100644 --- a/doc/source/user_guide/reshaping.rst +++ b/doc/source/user_guide/reshaping.rst @@ -729,6 +729,7 @@ Suppose we wanted to pivot ``df`` such that the ``col`` values are columns, particular, the resulting DataFrame should look like: .. code-block:: + :flake8-add-ignore: E999 col col0 col1 col2 col3 col4 row @@ -736,7 +737,7 @@ particular, the resulting DataFrame should look like: row2 0.13 NaN 0.395 0.500 0.25 row3 NaN 0.310 NaN 0.545 NaN row4 NaN 0.100 0.395 0.760 0.24 - + This solution uses :func:`~pandas.pivot_table`. Also note that ``aggfunc='mean'`` is the default. It is included here to be explicit. From 4e5cd54059a955d04490421412092a064c74f1ef Mon Sep 17 00:00:00 2001 From: oktaysabak Date: Tue, 8 Oct 2019 17:51:31 +0300 Subject: [PATCH 06/10] Update reshaping.rst --- doc/source/user_guide/reshaping.rst | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/doc/source/user_guide/reshaping.rst b/doc/source/user_guide/reshaping.rst index 63bde5a0d3d9c..3a5eb5cd9c7c6 100644 --- a/doc/source/user_guide/reshaping.rst +++ b/doc/source/user_guide/reshaping.rst @@ -728,8 +728,7 @@ Suppose we wanted to pivot ``df`` such that the ``col`` values are columns, ``row`` values are the index, and the mean of ``val0`` are the values? In particular, the resulting DataFrame should look like: -.. code-block:: - :flake8-add-ignore: E999 +.. code-block:: col col0 col1 col2 col3 col4 row @@ -737,7 +736,7 @@ particular, the resulting DataFrame should look like: row2 0.13 NaN 0.395 0.500 0.25 row3 NaN 0.310 NaN 0.545 NaN row4 NaN 0.100 0.395 0.760 0.24 - + This solution uses :func:`~pandas.pivot_table`. Also note that ``aggfunc='mean'`` is the default. It is included here to be explicit. From 8be9263fa1a9d7b02a74535934f4477af77d30ed Mon Sep 17 00:00:00 2001 From: oktaysabak Date: Tue, 8 Oct 2019 18:00:42 +0300 Subject: [PATCH 07/10] Update reshaping.rst --- doc/source/user_guide/reshaping.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/doc/source/user_guide/reshaping.rst b/doc/source/user_guide/reshaping.rst index 3a5eb5cd9c7c6..ee1af47b950c1 100644 --- a/doc/source/user_guide/reshaping.rst +++ b/doc/source/user_guide/reshaping.rst @@ -728,7 +728,7 @@ Suppose we wanted to pivot ``df`` such that the ``col`` values are columns, ``row`` values are the index, and the mean of ``val0`` are the values? In particular, the resulting DataFrame should look like: -.. code-block:: +.. code:: col col0 col1 col2 col3 col4 row @@ -736,7 +736,7 @@ particular, the resulting DataFrame should look like: row2 0.13 NaN 0.395 0.500 0.25 row3 NaN 0.310 NaN 0.545 NaN row4 NaN 0.100 0.395 0.760 0.24 - + This solution uses :func:`~pandas.pivot_table`. Also note that ``aggfunc='mean'`` is the default. It is included here to be explicit. From a68ed06e79ec4f03def9ff88f5a31c0a69b1e590 Mon Sep 17 00:00:00 2001 From: oktaysabak Date: Tue, 8 Oct 2019 19:43:12 +0300 Subject: [PATCH 08/10] Update reshaping.rst --- doc/source/user_guide/reshaping.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/user_guide/reshaping.rst b/doc/source/user_guide/reshaping.rst index ee1af47b950c1..a9468844d0e9c 100644 --- a/doc/source/user_guide/reshaping.rst +++ b/doc/source/user_guide/reshaping.rst @@ -728,7 +728,7 @@ Suppose we wanted to pivot ``df`` such that the ``col`` values are columns, ``row`` values are the index, and the mean of ``val0`` are the values? In particular, the resulting DataFrame should look like: -.. code:: +.. code-block:: html col col0 col1 col2 col3 col4 row From 163931a097249efd8ca366240274c8f40f7dded3 Mon Sep 17 00:00:00 2001 From: Oktay Sabak Date: Mon, 14 Oct 2019 19:19:04 +0300 Subject: [PATCH 09/10] Update reshaping.rst --- doc/source/user_guide/reshaping.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/user_guide/reshaping.rst b/doc/source/user_guide/reshaping.rst index a9468844d0e9c..e36be5432601b 100644 --- a/doc/source/user_guide/reshaping.rst +++ b/doc/source/user_guide/reshaping.rst @@ -728,7 +728,7 @@ Suppose we wanted to pivot ``df`` such that the ``col`` values are columns, ``row`` values are the index, and the mean of ``val0`` are the values? In particular, the resulting DataFrame should look like: -.. code-block:: html +.. code-block:: col col0 col1 col2 col3 col4 row From d84ff9672de1d9486adb6b7c89159c90a58cdf8c Mon Sep 17 00:00:00 2001 From: oktaysabak Date: Tue, 15 Oct 2019 12:29:38 +0300 Subject: [PATCH 10/10] .. code-block:: changed to .. code-block:: text --- doc/source/user_guide/reshaping.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/user_guide/reshaping.rst b/doc/source/user_guide/reshaping.rst index e36be5432601b..b2ee252495f23 100644 --- a/doc/source/user_guide/reshaping.rst +++ b/doc/source/user_guide/reshaping.rst @@ -728,7 +728,7 @@ Suppose we wanted to pivot ``df`` such that the ``col`` values are columns, ``row`` values are the index, and the mean of ``val0`` are the values? In particular, the resulting DataFrame should look like: -.. code-block:: +.. code-block:: text col col0 col1 col2 col3 col4 row