Open
Description
The tracker of items needed to do before deprecating DataFrame.to_html()
.
Blockers
- Acceptance of the
jinja2
requirement for HTML output, sinceStyler
requiresjinja2
. - Acceptance of removal/hard break of specific kwargs and all formatting keyword args (see below).
Development
- make
Styler.to_html
as performant or better thanDataFrame.to_html
(PERF: halve render time in Styler with itertuples #39972) (PERF: make Styler default formatter arguments statics instead of repeated dynamic #40425) (ENH: makeStyler
compatible with non-unique indexes #41269) - make Styler functional for all DataFrames (i.e. including non-unique columns, indexes) (ENH: make
Styler
compatible with non-unique indexes #41269). - enhance with ability to style indexes/column headers with styles (e.g bold rows) (ENH:
Styler.to_html
getsbold_headers
andcaption
kwarg #43149) -
enhancenot necessary.hide_columns
with.show_columns
alternative (optional) - add the sparsify kwargs (ENH:
sparse_columns
andsparse_index
added toStyler.to_html
#41946). - add render trimming to prevent browser crash on large data (ENH: set render limits on
Styler
to automatically trim dataframes #41635) - decide whether to add or drop max_rows / max_cols / min_rows (ENH:
max_rows
max_cols
kw forStyler.to_html
+styler.options
#42972) - enhance
.hide_columns
and.hide_index
to have dual function to hide the entire array, or specific items (API: makehide_columns
andhide_index
have a consistent signature and function inStyler
#41266 DEPR REF:hide(axis=..)
replaceshide_index
andhide_columns
#43771) - make styler reactive to separate sparse columns and index separately (ENH: add
styler
option context for sparsification of columns and index separately #41512) - add pandas options for
styler
for default output manipulation, using_repr_html_
methods (Opinion requested: Pandas Options for Styler #41395) - add the ability to render a a table_id even if exclude_styles is True (for back compat)
- add the ability to hide index names ENH: kw
names
toStyler.hide_index
#43346 -
add the(using DataFrame.style loses all default table styling googlecolab/colabtools#1687)class="dataframe"
attribute by default for google colab
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. |