From cf80663fcab2b78042e94b9fac0c229e253a1309 Mon Sep 17 00:00:00 2001 From: "JHM Darbyshire (iMac)" Date: Fri, 29 Apr 2022 20:54:05 +0200 Subject: [PATCH 1/4] whats new edits --- doc/source/whatsnew/v1.5.0.rst | 47 ++++++++++++++++++++-------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/doc/source/whatsnew/v1.5.0.rst b/doc/source/whatsnew/v1.5.0.rst index c85a087835b80..fb61c9a95ab38 100644 --- a/doc/source/whatsnew/v1.5.0.rst +++ b/doc/source/whatsnew/v1.5.0.rst @@ -37,10 +37,32 @@ The protocol consists of two parts: Styler ^^^^^^ - - New method :meth:`.Styler.to_string` for alternative customisable output methods (:issue:`44502`) - - Added the ability to render ``border`` and ``border-{side}`` CSS properties in Excel (:issue:`42276`) - - Added a new method :meth:`.Styler.concat` which allows adding customised footer rows to visualise additional calculations on the data, e.g. totals and counts etc. (:issue:`43875`, :issue:`46186`) - - :meth:`.Styler.highlight_null` now accepts ``color`` consistently with other builtin methods and deprecates ``null_color`` although this remains backwards compatible (:issue:`45907`) +The most notable development is the new method new method :meth:`.Styler.concat` which +allows adding customised footer rows to visualise additional calculations on the data, +e.g. totals and counts etc. (:issue:`43875`, :issue:`46186`) + +.. ipython:: python + + descriptors = df.agg(["sum", "mean", lambda s: s.dtype]) + descriptors.index = ["Total", "Average", "dtype"] + other = descriptors.style + other.highlight_max(axis=1, subset=(["Total", "Average"], slice(None))) + other.format(subset=("Average", slice(None)), precision=2, decimal=",") + other.applymap(lambda v: "font-weight: bold;") + styler = df.style + styler.highlight_max(color="salmon") + styler.set_table_styles( + [{"selector": ".foot_row0", "props": "border-top: 1px solid black;"}] + ) + styler.concat(other) + +Additionally there is also an alternative output method :meth:`.Styler.to_string`, +which allows using the Styler's formatting methods to create, for example, CSVs (:issue:`44502`). + +Minor feature improvements are: + + - Adding the ability to render ``border`` and ``border-{side}`` CSS properties in Excel (:issue:`42276`) + - Making keyword arguments consist: :meth:`.Styler.highlight_null` now accepts ``color`` and deprecates ``null_color`` although this remains backwards compatible (:issue:`45907`) .. _whatsnew_150.enhancements.resample_group_keys: @@ -127,13 +149,6 @@ Notable bug fixes These are bug fixes that might have notable behavior changes. -.. _whatsnew_150.notable_bug_fixes.notable_bug_fix1: - -Styler -^^^^^^ - -- Fixed bug in :class:`CSSToExcelConverter` leading to ``TypeError`` when border color provided without border style for ``xlsxwriter`` engine (:issue:`42276`) - .. _whatsnew_150.notable_bug_fixes.groupby_transform_dropna: Using ``dropna=True`` with ``groupby`` transforms @@ -194,13 +209,6 @@ did not have the same index as the input. df.groupby('a', dropna=True).transform('ffill') df.groupby('a', dropna=True).transform(lambda x: x) -.. _whatsnew_150.notable_bug_fixes.visualization: - -Styler -^^^^^^ - -- Fix showing "None" as ylabel in :meth:`Series.plot` when not setting ylabel (:issue:`46129`) - .. _whatsnew_150.notable_bug_fixes.notable_bug_fix2: notable_bug_fix2 @@ -615,6 +623,7 @@ Plotting - Bug in :meth:`DataFrame.boxplot` that prevented specifying ``vert=False`` (:issue:`36918`) - Bug in :meth:`DataFrame.plot.scatter` that prevented specifying ``norm`` (:issue:`45809`) - The function :meth:`DataFrame.plot.scatter` now accepts ``color`` as an alias for ``c`` and ``size`` as an alias for ``s`` for consistency to other plotting functions (:issue:`44670`) +- Fix showing "None" as ylabel in :meth:`Series.plot` when not setting ylabel (:issue:`46129`) Groupby/resample/rolling ^^^^^^^^^^^^^^^^^^^^^^^^ @@ -659,7 +668,7 @@ ExtensionArray Styler ^^^^^^ - Bug when attempting to apply styling functions to an empty DataFrame subset (:issue:`45313`) -- +- Bug in :class:`CSSToExcelConverter` leading to ``TypeError`` when border color provided without border style for ``xlsxwriter`` engine (:issue:`42276`) Metadata ^^^^^^^^ From 3a26b10493acf8974dbc1f9c68184cc5011e34e6 Mon Sep 17 00:00:00 2001 From: "JHM Darbyshire (iMac)" Date: Fri, 29 Apr 2022 21:49:52 +0200 Subject: [PATCH 2/4] whats new edits --- doc/source/whatsnew/v1.5.0.rst | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/doc/source/whatsnew/v1.5.0.rst b/doc/source/whatsnew/v1.5.0.rst index fb61c9a95ab38..a4f0ac25b11f0 100644 --- a/doc/source/whatsnew/v1.5.0.rst +++ b/doc/source/whatsnew/v1.5.0.rst @@ -41,21 +41,6 @@ The most notable development is the new method new method :meth:`.Styler.concat` allows adding customised footer rows to visualise additional calculations on the data, e.g. totals and counts etc. (:issue:`43875`, :issue:`46186`) -.. ipython:: python - - descriptors = df.agg(["sum", "mean", lambda s: s.dtype]) - descriptors.index = ["Total", "Average", "dtype"] - other = descriptors.style - other.highlight_max(axis=1, subset=(["Total", "Average"], slice(None))) - other.format(subset=("Average", slice(None)), precision=2, decimal=",") - other.applymap(lambda v: "font-weight: bold;") - styler = df.style - styler.highlight_max(color="salmon") - styler.set_table_styles( - [{"selector": ".foot_row0", "props": "border-top: 1px solid black;"}] - ) - styler.concat(other) - Additionally there is also an alternative output method :meth:`.Styler.to_string`, which allows using the Styler's formatting methods to create, for example, CSVs (:issue:`44502`). From 3cd3d1a9865568a241fccdb58683653b3eaa5b51 Mon Sep 17 00:00:00 2001 From: "JHM Darbyshire (iMac)" Date: Fri, 29 Apr 2022 21:50:38 +0200 Subject: [PATCH 3/4] whats new edits --- doc/source/whatsnew/v1.5.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v1.5.0.rst b/doc/source/whatsnew/v1.5.0.rst index a4f0ac25b11f0..270342d24a4c8 100644 --- a/doc/source/whatsnew/v1.5.0.rst +++ b/doc/source/whatsnew/v1.5.0.rst @@ -37,7 +37,7 @@ The protocol consists of two parts: Styler ^^^^^^ -The most notable development is the new method new method :meth:`.Styler.concat` which +The most notable development is the new method :meth:`.Styler.concat` which allows adding customised footer rows to visualise additional calculations on the data, e.g. totals and counts etc. (:issue:`43875`, :issue:`46186`) From 8be48d31844d0e95e18b0ba006ee719507fc5024 Mon Sep 17 00:00:00 2001 From: "JHM Darbyshire (iMac)" Date: Fri, 29 Apr 2022 21:51:04 +0200 Subject: [PATCH 4/4] whats new edits --- doc/source/whatsnew/v1.5.0.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/doc/source/whatsnew/v1.5.0.rst b/doc/source/whatsnew/v1.5.0.rst index 270342d24a4c8..9f8ab3118751d 100644 --- a/doc/source/whatsnew/v1.5.0.rst +++ b/doc/source/whatsnew/v1.5.0.rst @@ -41,7 +41,7 @@ The most notable development is the new method :meth:`.Styler.concat` which allows adding customised footer rows to visualise additional calculations on the data, e.g. totals and counts etc. (:issue:`43875`, :issue:`46186`) -Additionally there is also an alternative output method :meth:`.Styler.to_string`, +Additionally there is an alternative output method :meth:`.Styler.to_string`, which allows using the Styler's formatting methods to create, for example, CSVs (:issue:`44502`). Minor feature improvements are: