From 0c4d23817dc64996ac04d21c67e8517786aed813 Mon Sep 17 00:00:00 2001 From: Chen XU <849237780@qq.com> Date: Tue, 18 Apr 2023 13:58:40 +0000 Subject: [PATCH 1/2] just add an e.g. --- pandas/core/frame.py | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 5341b87c39676..596d5378da8af 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -3100,6 +3100,15 @@ def to_html( .. versionadded:: 1.0 %(returns)s + + Examples + -------- + Create, write to and save a workbook: + >>> df1 = pd.DataFrame([['a', 'b'], ['c', 'd']], + ... index=['row 1', 'row 2'], + ... columns=['col 1', 'col 2']) + >>> df1.to_html("output.html") # doctest: +SKIP + See Also -------- to_string : Convert DataFrame to a string. From 1019f349f8edd531a8e10f8f9bdd14a17143a366 Mon Sep 17 00:00:00 2001 From: Chen XU <849237780@qq.com> Date: Tue, 18 Apr 2023 14:44:51 +0000 Subject: [PATCH 2/2] change order --- pandas/core/frame.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 596d5378da8af..98bb3914fa522 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -3101,6 +3101,10 @@ def to_html( .. versionadded:: 1.0 %(returns)s + See Also + -------- + to_string : Convert DataFrame to a string. + Examples -------- Create, write to and save a workbook: @@ -3108,10 +3112,6 @@ def to_html( ... index=['row 1', 'row 2'], ... columns=['col 1', 'col 2']) >>> df1.to_html("output.html") # doctest: +SKIP - - See Also - -------- - to_string : Convert DataFrame to a string. """ if justify is not None and justify not in fmt._VALID_JUSTIFY_PARAMETERS: raise ValueError("Invalid value for justify parameter")