8000 ENH: make `Styler` compatible with non-unique indexes by attack68 · Pull Request #41269 · pandas-dev/pandas · GitHub
[go: up one dir, main page]

Skip to content

ENH: make Styler compatible with non-unique indexes #41269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
May 6, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
22 commits
Select commit Hold shift + click to select a range
1cc569f
ENH: make `Styler.format` compatible with non-unique indexes (with Te…
attack68 May 2, 2021
6982554
ENH: error when using a non-unique subset with .apply and .applymap (…
attack68 May 2, 2021
a3694db
ENH: error when using a non-unique subset with .apply and .applymap: …
attack68 May 2, 2021
5c6669c
ENH: make table_styles work with non-unique + TST: refactor to own file
attack68 May 2, 2021
732c7d5
ENH: error catching
attack68 May 2, 2021
4c99130
ENH: error catching
attack68 May 2, 2021
57e8bef
Merge remote-tracking branch 'upstream/master' into styler_non_unique
attack68 May 3, 2021
a7a2966
ENH: deal with tooltips and raise (inc Tests)
attack68 May 3, 2021
19fb7f9
ENH: deal with tooltips and raise (inc Tests)
attack68 May 3, 2021
4ce559e
ENH: deal with tset_td_classes and raise (inc Tests)
attack68 May 3, 2021
7f28111
ENH: tests for hide_columns
attack68 May 3, 2021
5043c01
ENH: remove style ValueError
attack68 May 3, 2021
9fc6cd3
Merge remote-tracking branch 'upstream/master' into styler_non_uniqu 8000 e
attack68 May 4, 2021
09764ba
whats new
attack68 May 4, 2021
9451aae
Merge remote-tracking branch 'upstream/master' into styler_non_unique
attack68 May 5, 2021
4faeb29
prohibit apply and applymap in non-unique case
attack68 May 5, 2021
aed0536
Merge remote-tracking branch 'upstream/master' into styler_non_unique
attack68 May 6, 2021
3a8f11e
move outside loop
attack68 May 6, 2021
51233be
create conditional for performance
attack68 May 6, 2021
8454c5e
create conditional for performance
attack68 May 6, 2021
c3b7af8
take indexing out of loops
attack68 May 6, 2021
20cd19f
take indexing out of loops
attack68 May 6, 2021
File filter

Filter by extension

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: deal with tooltips and raise (inc Tests)
  • Loading branch information
attack68 committed May 3, 2021
commit 19fb7f9c3ae72bdc9c0cc978469ae63b2e56c743
2 changes: 1 addition & 1 deletion pandas/io/formats/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,7 +324,7 @@ def set_tooltips(
)
if not ttips.index.is_unique or not ttips.columns.is_unique:
raise KeyError(
"Tooltips renders only if `ttips` has unique index and columns."
"Tooltips render only if `ttips` has unique index and columns."
)
if self.tooltips is None: # create a default instance if necessary
self.tooltips = Tooltips()
Expand Down
4 changes: 2 additions & 2 deletions pandas/tests/io/formats/style/test_non_unique.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ def test_tooltips_non_unique_raises(styler):

# ttips has non-unique columns
ttips = DataFrame([["1", "2"], ["3", "4"]], columns=["c", "c"], index=["a", "b"])
with pytest.raises(KeyError, match="Tooltips renders only if `ttips` has unique"):
with pytest.raises(KeyError, match="Tooltips render only if `ttips` has unique"):
styler.set_tooltips(ttips=ttips)

# ttips has non-unique index
ttips = DataFrame([["1", "2"], ["3", "4"]], columns=["c", "d"], index=["a", "a"])
with pytest.raises(KeyError, match="Tooltips renders only if `ttips` has unique"):
with pytest.raises(KeyError, match="Tooltips render only if `ttips` has unique"):
styler.set_tooltips(ttips=ttips)
0