You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For 20,000 groups the function takes 260 ms ± 12.2 ms
- Alternative approach, how to get in the dots in the middle elegantly?
def _repr_html_(self) -> str:
group_names = list(self.groups.keys())
max_groups = get_option("display.max_groups")
if max_groups < self.ngroups:
n_start = (max_groups + 1) // 2
n_end = max_groups - n_start
group_names = group_names[:n_start] + group_names[-n_end:]
repr_html = ""
for group_name in group_names:
group = self.groups[group_name]
if not hasattr(group, "to_html"):
group = group.to_frame()
repr_html += f"<H3>Group Key: {group_name}<H3/>"
repr_html += group.to_html(
max_rows=get_option("display.max_rows") // self.ngroups
)
return repr_html
0 commit comments