@@ -685,6 +685,130 @@ def to_string(
685
685
"""
686
686
raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
687
687
688
+ def to_html (
689
+ self ,
690
+ buf = None ,
691
+ columns : Sequence [str ] | None = None ,
692
+ col_space = None ,
693
+ header : bool = True ,
694
+ index : bool = True ,
695
+ na_rep : str = "NaN" ,
696
+ formatters = None ,
697
+ float_format = None ,
698
+ sparsify : bool | None = None ,
699
+ index_names : bool = True ,
700
+ justify : str | None = None ,
701
+ max_rows : int | None = None ,
702
+ max_cols : int | None = None ,
703
+ show_dimensions : bool = False ,
704
+ decimal : str = "." ,
705
+ bold_rows : bool = True ,
706
+ classes : str | list | tuple | None = None ,
707
+ escape : bool = True ,
708
+ notebook : bool = False ,
709
+ border : int | None = None ,
710
+ table_id : str | None = None ,
711
+ render_links : bool = False ,
712
+ encoding : str | None = None ,
713
+ ):
714
+ """Render a DataFrame as an HTML table.
715
+
716
+ **Examples:**
717
+
718
+ >>> import bigframes.pandas as bpd
719
+ >>> bpd.options.display.progress_bar = None
720
+
721
+ >>> df = bpd.DataFrame({'col1': [1, 2], 'col2': [3, 4]})
722
+ >>> print(df.to_html())
723
+ <table border="1" class="dataframe">
724
+ <thead>
725
+ <tr style="text-align: right;">
726
+ <th></th>
727
+ <th>col1</th>
728
+ <th>col2</th>
729
+ </tr>
730
+ </thead>
731
+ <tbody>
732
+ <tr>
733
+ <th>0</th>
734
+ <td>1</td>
735
+ <td>3</td>
736
+ </tr>
737
+ <tr>
738
+ <th>1</th>
739
+ <td>2</td>
740
+ <td>4</td>
741
+ </tr>
742
+ </tbody>
743
+ </table>
744
+
745
+ Args:
746
+ buf (str, Path or StringIO-like, optional, default None):
747
+ Buffer to write to. If None, the output is returned as a string.
748
+ columns (sequence, optional, default None):
749
+ The subset of columns to write. Writes all columns by default.
750
+ col_space (str or int, list or dict of int or str, optional):
751
+ The minimum width of each column in CSS length units. An int is
752
+ assumed to be px units.
753
+ header (bool, optional):
754
+ Whether to print column labels, default True.
755
+ index (bool, optional, default True):
756
+ Whether to print index (row) labels.
757
+ na_rep (str, optional, default 'NaN'):
758
+ String representation of NAN to use.
759
+ formatters (list, tuple or dict of one-param. functions, optional):
760
+ Formatter functions to apply to columns' elements by position or
761
+ name.
762
+ The result of each function must be a unicode string.
763
+ List/tuple must be of length equal to the number of columns.
764
+ float_format (one-parameter function, optional, default None):
765
+ Formatter function to apply to columns' elements if they are
766
+ floats. This function must return a unicode string and will
767
+ be applied only to the non-NaN elements, with NaN being
768
+ handled by na_rep.
769
+ sparsify (bool, optional, default True):
770
+ Set to False for a DataFrame with a hierarchical index to print
771
+ every multiindex key at each row.
772
+ index_names (bool, optional, default True):
773
+ Prints the names of the indexes.
774
+ justify (str, default None):
775
+ How to justify the column labels. If None uses the option from
776
+ the print configuration (controlled by set_option), 'right' out
777
+ of the box. Valid values are, 'left', 'right', 'center', 'justify',
778
+ 'justify-all', 'start', 'end', 'inherit', 'match-parent', 'initial',
779
+ 'unset'.
780
+ max_rows (int, optional):
781
+ Maximum number of rows to display in the console.
782
+ max_cols (int, optional):
783
+ Maximum number of columns to display in the console.
784
+ show_dimensions (bool, default False):
785
+ Display DataFrame dimensions (number of rows by number of columns).
786
+ decimal (str, default '.'):
787
+ Character recognized as decimal separator, e.g. ',' in Europe.
788
+ bold_rows (bool, default True):
789
+ Make the row labels bold in the output.
790
+ classes (str or list or tuple, default None):
791
+ CSS class(es) to apply to the resulting html table.
792
+ escape (bool, default True):
793
+ Convert the characters <, >, and & to HTML-safe sequences.
794
+ notebook (bool, default False):
795
+ Whether the generated HTML is for IPython Notebook.
796
+ border (int):
797
+ A border=border attribute is included in the opening <table>
798
+ tag. Default pd.options.display.html.border.
799
+ table_id (str, optional):
800
+ A css id is included in the opening <table> tag if specified.
801
+ render_links (bool, default False):
802
+ Convert URLs to HTML links.
803
+ encoding (str, default "utf-8"):
804
+ Set character encoding.
805
+
806
+ Returns:
807
+ str or None: If buf is None, returns the result as a string. Otherwise
808
+ returns None.
809
+ """
810
+ raise NotImplementedError (constants .ABSTRACT_METHOD_ERROR_MESSAGE )
811
+
688
812
def to_markdown (
689
813
self ,
690
814
buf = None ,
0 commit comments