diff --git a/pandas/core/frame.py b/pandas/core/frame.py index a469f4965117b..59d1d23d46f74 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -3133,8 +3133,29 @@ def to_html( Examples -------- - >>> df = pd.DataFrame([[1, 2], [3, 4]], columns=['A', 'B']) - >>> df.to_html() # doctest: +SKIP + >>> df = pd.DataFrame(data={'col1': [1, 2], 'col2': [4, 3]}) + >>> html_string = ''' + ... + ... + ... + ... + ... + ... + ... + ... + ... + ... + ... + ... + ... + ... + ... + ... + ... + ... + ... + ...
col1col2
014
123
''' + >>> assert html_string == df.to_html() """ if justify is not None and justify not in fmt._VALID_JUSTIFY_PARAMETERS: raise ValueError("Invalid value for justify parameter")