Skip to content

Commit 33d5e5d

Browse files
committed
removed aruments from init
1 parent 39dfbd5 commit 33d5e5d

File tree

1 file changed

+10
-24
lines changed

1 file changed

+10
-24
lines changed

pandas/io/formats/style.py

Lines changed: 10 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -63,15 +63,6 @@ class Styler(object):
6363
a unique identifier to avoid CSS collisons; generated automatically
6464
caption: str, default None
6565
caption to attach to the table
66-
index: bool, default True
67-
determines if the index is rendered in the html output
68-
69-
.. versionadded:: 0.21.0
70-
71-
hidden_columns: IndexSlice, default None
72-
hides a subset of columns from rendering
73-
74-
.. versionadded:: 0.21.0
7566
7667
Attributes
7768
----------
@@ -120,8 +111,7 @@ class Styler(object):
120111
template = env.get_template("html.tpl")
121112

122113
def __init__(self, data, precision=None, table_styles=None, uuid=None,
123-
caption=None, table_attributes=None, index=True,
124-
hidden_columns=None):
114+
caption=None, table_attributes=None):
125115
self.ctx = defaultdict(list)
126116
self._todo = []
127117

@@ -143,10 +133,8 @@ def __init__(self, data, precision=None, table_styles=None, uuid=None,
143133
precision = get_option('display.precision')
144134
self.precision = precision
145135
self.table_attributes = table_attributes
146-
self.index_visible = index
147-
if hidden_columns is None:
148-
hidden_columns = []
149-
self.hidden_columns = hidden_columns
136+
self.hidden_index = False
137+
self.hidden_columns = []
150138

151139
# display_funcs maps (row, col) -> formatting function
152140

@@ -195,7 +183,7 @@ def _translate(self):
195183
caption = self.caption
196184
ctx = self.ctx
197185
precision = self.precision
198-
index_visible = self.index_visible
186+
hidden_index = self.hidden_index
199187
hidden_columns = self.hidden_columns
200188
uuid = self.uuid or str(uuid1()).replace("-", "_")
201189
ROW_HEADING_CLASS = "row_heading"
@@ -234,7 +222,7 @@ def format_attr(pair):
234222
row_es = [{"type": "th",
235223
"value": BLANK_VALUE,
236224
"display_value": BLANK_VALUE,
237-
"is_visible": index_visible,
225+
"is_visible": not hidden_index,
238226
"class": " ".join([BLANK_CLASS])}] * (n_rlvls - 1)
239227

240228
# ... except maybe the last for columns.names
@@ -246,7 +234,7 @@ def format_attr(pair):
246234
"value": name,
247235
"display_value": name,
248236
"class": " ".join(cs),
249-
"is_visible": index_visible})
237+
"is_visible": not hidden_index})
250238

251239
if clabels:
252240
for c, value in enumerate(clabels[r]):
@@ -296,8 +284,8 @@ def format_attr(pair):
296284
"row{row}".format(row=r)]
297285
es = {
298286
"type": "th",
299-
"is_visible": (_is_visible(r, c, idx_lengths) &
300-
index_visible),
287+
"is_visible": (_is_visible(r, c, idx_lengths) and
288+
not hidden_index),
301289
"value": value,
302290
"display_value": value,
303291
"id": "_".join(rid[1:]),
@@ -477,9 +465,7 @@ def _update_ctx(self, attrs):
477465
def _copy(self, deepcopy=False):
478466
styler = Styler(self.data, precision=self.precision,
479467
caption=self.caption, uuid=self.uuid,
480-
table_styles=self.table_styles,
481-
index=self.index_visible,
482-
hidden_columns=self.hidden_columns)
468+
table_styles=self.table_styles)
483469
if deepcopy:
484470
styler.ctx = copy.deepcopy(self.ctx)
485471
styler._todo = copy.deepcopy(self._todo)
@@ -816,7 +802,7 @@ def hide_index(self):
816802
-------
817803
self : Styler
818804
"""
819-
self.index_visible = False
805+
self.hidden_index = True
820806
return self
821807

822808
def hide_columns(self, subset):

0 commit comments

Comments
 (0)