Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
af99333
ENH: add named based column css styling to pandas Styler
attack68 Aug 7, 2020
c8097ed
ENH: add named based column css styling to pandas Styler (black fixup)
attack68 Aug 7, 2020
07591da
ENH: add named based column css styling to pandas Styler (black fixup)
attack68 Aug 7, 2020
d143824
ENH: add named based column css styling to pandas Styler (black fixup)
attack68 Aug 7, 2020
a4ebd1a
ENH: restructure code for no new functions, only keyword additions
attack68 Aug 7, 2020
cae9159
ENH: black fix
attack68 Aug 7, 2020
08fc864
ENH: changes requested in issue
attack68 Aug 8, 2020
eb4abea
Merge remote-tracking branch 'upstream/master' into styler_column_sty…
attack68 Sep 8, 2020
f5b4b79
Merge remote-tracking branch 'upstream/master' into styler_column_sty…
attack68 Sep 9, 2020
6cea000
Merge remote-tracking branch 'upstream/master' into styler_column_sty…
attack68 Sep 13, 2020
fc281af
Merge remote-tracking branch 'upstream/master' into styler_column_sty…
attack68 Sep 17, 2020
f61b6ba
Merge remote-tracking branch 'upstream/master' into styler_column_sty…
attack68 Sep 19, 2020
6abbe99
Merge remote-tracking branch 'upstream/master' into styler_column_sty…
attack68 Sep 20, 2020
d7f7e72
fix test after recent merge master
attack68 Sep 20, 2020
18d5d68
Merge remote-tracking branch 'upstream/master' into styler_column_sty…
attack68 Sep 21, 2020
29e02df
Merge remote-tracking branch 'upstream/master' into styler_column_sty…
TomAugspurger Sep 25, 2020
31499ba
Merge remote-tracking branch 'upstream/master' into styler_column_sty…
attack68 Sep 28, 2020
6dbd2ca
Merge remote-tracking branch 'upstream/master' into styler_column_sty…
attack68 Sep 29, 2020
c0ea225
Merge remote-tracking branch 'upstream/master' into styler_column_sty…
attack68 Nov 5, 2020
0792752
style fix
attack68 Nov 5, 2020
6f6c758
Merge remote-tracking branch 'upstream/master' into styler_column_sty…
attack68 Nov 22, 2020
93d3f8d
TYPE: add type for set_table_styles
attack68 Nov 22, 2020
d5a6fbb
TYPE: revert chgs
attack68 Nov 22, 2020
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
ENH: black fix
  • Loading branch information
attack68 committed Aug 28, 2020
commit cae9159b8811336b1e643b1314d59a4ecb309657
6 changes: 3 additions & 3 deletions pandas/io/formats/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -966,12 +966,12 @@ def set_table_styles(self, table_styles, axis=0, overwrite=True) -> "Styler":
... }, axis=1, overwrite=False)
"""
if isinstance(table_styles, dict):
if axis == 0 or axis == 'index':
if axis == 0 or axis == "index":
obj = self.data.columns
idf = '.col'
idf = ".col"
else:
obj = self.data.index
idf = '.row'
idf = ".row"

_styles = []
for key, styles in table_styles.items():
Expand Down
9 changes: 3 additions & 6 deletions pandas/tests/io/formats/test_style.py
Original file line number Diff line number Diff line change
Expand Up @@ -1697,20 +1697,17 @@ def test_chaining_table_styles(self):
[{"selector": "", "props": [("background-color", "yellow")]}]
).set_table_styles(
[{"selector": ".col0", "props": [("background-color", "blue")]}],
overwrite=False
overwrite=False,
)
assert len(styler.table_styles) == 2

def test_column_and_row_styling(self):
df = pd.DataFrame(data=[[0, 1], [1, 2]], columns=["A", "B"])
s = Styler(df, uuid="_")
s = s.set_table_styles(
{"A": [{"selector": "", "props": [("color", "blue")]}]}
)
s = s.set_table_styles({"A": [{"selector": "", "props": [("color", "blue")]}]})
assert "#T__ .col0 {\n color: blue;\n }" in s.render()
s = s.set_table_styles(
{0: [{"selector": "", "props": [("color", "blue")]}]},
axis=1
{0: [{"selector": "", "props": [("color", "blue")]}]}, axis=1
)
assert "#T__ .row0 {\n color: blue;\n }" in s.render()

Expand Down