Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
12 of 15 tasks
attack68 opened this issue May 27, 2021 · 1 comment
Open
12 of 15 tasks

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

attack68 opened this issue May 27, 2021 · 1 comment
Labels
IO HTML read_html, to_html, Styler.apply, Styler.applymap Master Tracker High level tracker for similar issues Refactor Internal refactoring of code Styler conditional formatting using DataFrame.style

Comments

@attack68
Copy link
Contributor

attack68 commented May 27, 2021

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.
@attack68 attack68 added IO HTML read_html, to_html, Styler.apply, Styler.applymap Deprecate Functionality to remove in pandas Master Tracker High level tracker for similar issues Styler conditional formatting using DataFrame.style labels May 27, 2021
@pandas-dev pandas-dev deleted a comment from Lokeshrathi Aug 22, 2021
@rhshadrach rhshadrach changed the title DEPR: DataFrame.to_html in favour of Styler.to_html REF: DataFrame.to_html should call Styler.to_html Jun 25, 2022
@rhshadrach rhshadrach removed the Deprecate Functionality to remove in pandas label Jun 25, 2022
@rhshadrach
Copy link
Member

@attack68 - from #44451 it appears that you and @jorisvandenbossche are in favor of keeping DataFrame.to_html as a wrapper around Styler.to_html. I'm +1 here as well. I've retitled this issue to reflect that and removed the deprecation tag, but please adjust if this is not correct.

@rhshadrach rhshadrach added the Refactor Internal refactoring of code label Jun 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IO HTML read_html, to_html, Styler.apply, Styler.applymap Master Tracker High level tracker for similar issues Refactor Internal refactoring of code Styler conditional formatting using DataFrame.style
Projects
None yet
Development

No branches or pull requests

2 participants