Skip to content

REF: DataFrame.to_html should call Styler.to_html #41693

Open
@attack68

Description

@attack68

The tracker of items needed to do before deprecating DataFrame.to_html().

Blockers

  • Acceptance of the jinja2 requirement for HTML output, since Styler requires jinja2.
  • Acceptance of removal/hard break of specific kwargs and all formatting keyword args (see below).

Development

Treatment of Keyword Args

Old Keyword New Keyword Reason
buf buf
encoding encoding
table_id table_uuid
classes table_attributes extended utility
sparsify sparse_index
sparse_columns
more control of individual components
max_rows
min_rows
max_cols
max_rows
max_columns
min_rows removed since it is console related
bold_rows bold_headers included to allows some back compatability
... doctype_html adds ability to form a full HTML document or just style and table HTML elements.
... exclude_styles adds ability to more closely replicate DataFrame.to_html by dropping extra features.
... caption adds ability to set a caption on Styler from the calling method.
na_rep
formatters
float_format
decimal
escape
removed replaced by Styler.format(...) which has more control
columns
header
index
removed replaced by Styler.hide_index(...) and Styler.hide_columns(...)
border removed deprecated HTML should be controlled with CSS
col_space removed should be controlled with CSS, e.g. 'min-width: 100px;'
render_links removed not useful. only renders links identified as http[...], not as sub part of string, i.e. other http[...] text. if required should be added to Styler.format(...)
notebook removed This seems to only provide minor alignment changes that should be controlled with other CSS
show_dimensions removed This information is not needed in an HTML table of the DataFrame. df.shape provides the necessary workaround, and as a last resort caption=f"dimension: {df.shape}" displays the info.
justify removed since this is a styling arg which should be dealt with by other methods.
index_names removed assumed index names are removed from DataFrame if unwanted. As an alternative hide_columns could introduce a keyword argument to specifically hide the index names row.

Metadata

Metadata

Assignees

No one assigned

    Labels

    IO HTMLread_html, to_html, Styler.apply, Styler.applymapMaster TrackerHigh level tracker for similar issuesRefactorInternal refactoring of codeStylerconditional formatting using DataFrame.style

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions