Skip to content

Commit 556f437

Browse files
authored
ASV: rendering hidden elements in Styler (#43687)
1 parent f1a8999 commit 556f437

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

asv_bench/benchmarks/io/style.py

+14
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,14 @@ def peakmem_format_render(self, cols, rows):
4242
self._style_format()
4343
self.st._render_html(True, True)
4444

45+
def time_apply_format_hide_render(self, cols, rows):
46+
self._style_apply_format_hide()
47+
self.st._render_html(True, True)
48+
49+
def peakmem_apply_format_hide_render(self, cols, rows):
50+
self._style_apply_format_hide()
51+
self.st._render_html(True, True)
52+
4553
def _style_apply(self):
4654
def _apply_func(s):
4755
return [
@@ -63,3 +71,9 @@ def _style_format(self):
6371
self.st = self.df.style.format(
6472
"{:,.3f}", subset=IndexSlice["row_1":f"row_{ir}", "float_1":f"float_{ic}"]
6573
)
74+
75+
def _style_apply_format_hide(self):
76+
self.st = self.df.style.applymap(lambda v: "color: red;")
77+
self.st.format("{:.3f}")
78+
self.st.hide_index(self.st.index[1:])
79+
self.st.hide_columns(self.st.columns[1:])

0 commit comments

Comments
 (0)