From 39e3a3ad78a44b05bdede0a74e8c2db531e2c813 Mon Sep 17 00:00:00 2001 From: William Wai Lim Chan Date: Sun, 25 Jul 2021 12:01:53 -0400 Subject: [PATCH 1/3] fixed doctest in styler.to_latex --- pandas/io/formats/style.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index 91a301b665f7c..776ae39473b91 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -536,7 +536,15 @@ def to_latex( >>> df = pd.DataFrame([[1,2], [3,4]]) >>> s = df.style.highlight_max(axis=None, ... props='background-color:red; font-weight:bold;') - >>> s.render() + >>> s.render() #doctest: +ELLIPSIS + '\n\n \n \n \n + \n \n + \n \n \n \n \n + \n \n + \n \n \n + \n \n + \n \n
 01
012
134
\n' The equivalent using LaTeX only commands is the following: From f743a34f229ba0d37956da06b75e9a0fd14567f2 Mon Sep 17 00:00:00 2001 From: William Wai Lim Chan Date: Sun, 25 Jul 2021 12:17:24 -0400 Subject: [PATCH 2/3] fixed linting issues --- pandas/io/formats/style.py | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index 776ae39473b91..f521266eb2b20 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -537,14 +537,16 @@ def to_latex( >>> s = df.style.highlight_max(axis=None, ... props='background-color:red; font-weight:bold;') >>> s.render() #doctest: +ELLIPSIS - '\n\n \n \n \n - \n \n - \n \n \n \n \n - \n \n - \n \n \n - \n \n - \n \n
 01
012
134
\n' + '\n\n \n \n + \n + \n \n \n \n \n + \n \n + \n \n \n \n \n \n \n \n \n
 01
012
134
\n' The equivalent using LaTeX only commands is the following: From 5968c925f1c5ce52161031130acd76cf01c3ee59 Mon Sep 17 00:00:00 2001 From: William Wai Lim Chan Date: Sun, 25 Jul 2021 12:19:41 -0400 Subject: [PATCH 3/3] removed trailing whitespace --- pandas/io/formats/style.py | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index f521266eb2b20..11814c4f7ccc7 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -537,15 +537,16 @@ def to_latex( >>> s = df.style.highlight_max(axis=None, ... props='background-color:red; font-weight:bold;') >>> s.render() #doctest: +ELLIPSIS - '\n\n \n \n - \n - \n \n \n \n \n - \n \n - \n \n \n \n \n \n
 01
012
13\n#..._row1_col1 {\n background-color: red;\n + font-weight: bold;\n}\n\n\n \n \n + \n \n \n + \n \n \n \n \n \n \n \n \n \n \n \n \n \n
 01
012
134
\n' The equivalent using LaTeX only commands is the following: