From fa4a67a61a5967ba32e82de5541beb10dd8c7a56 Mon Sep 17 00:00:00 2001 From: Elisa Malzoni Date: Thu, 15 Aug 2019 09:08:03 -0300 Subject: [PATCH 1/2] Fixes issue #27563 --- pandas/core/config_init.py | 2 ++ pandas/io/formats/html.py | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/pandas/core/config_init.py b/pandas/core/config_init.py index 08dce6aca6e6d..61b944a389e52 100644 --- a/pandas/core/config_init.py +++ b/pandas/core/config_init.py @@ -343,6 +343,8 @@ def is_terminal(): ) cf.register_option("max_categories", 8, pc_max_categories_doc, validator=is_int) cf.register_option("max_colwidth", 50, max_colwidth_doc, validator=is_int) + cf.register_option("repeating_row_index", 0, validator=is_int) + if is_terminal(): max_cols = 0 # automatically determine optimal number of columns else: diff --git a/pandas/io/formats/html.py b/pandas/io/formats/html.py index 4b44893df70ed..db83e71e7f635 100644 --- a/pandas/io/formats/html.py +++ b/pandas/io/formats/html.py @@ -420,6 +420,10 @@ def _write_regular_rows( tags=None, nindex_levels=self.row_levels, ) + j = get_option("display.repeating_row_index") + + if j > 0 and i % j == 0 and i > 0 : + row.append(self._write_col_header(indent)) row = [] if self.fmt.index: From 901885afd9990feb8d20ef06a7619786e93e73fb Mon Sep 17 00:00:00 2001 From: Elisa Malzoni Date: Thu, 22 Aug 2019 11:54:41 -0300 Subject: [PATCH 2/2] remove blank spaces for PEP8 --- pandas/io/formats/html.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pandas/io/formats/html.py b/pandas/io/formats/html.py index db83e71e7f635..231ec90d9f013 100644 --- a/pandas/io/formats/html.py +++ b/pandas/io/formats/html.py @@ -421,8 +421,7 @@ def _write_regular_rows( nindex_levels=self.row_levels, ) j = get_option("display.repeating_row_index") - - if j > 0 and i % j == 0 and i > 0 : + if j > 0 and i % j == 0 and i > 0: row.append(self._write_col_header(indent)) row = []