Skip to content
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

REF: Transfer DataFrame.to_latex to Styler implementation for v1.5.0 #45382

Closed
wants to merge 55 commits into from
Closed
Changes from 1 commit
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
b3c55af
setup new kwarg
attack68 Jan 6, 2022
c68944a
method and raise on error
attack68 Jan 7, 2022
929df89
Merge remote-tracking branch 'upstream/master' into styler_format_ali…
attack68 Jan 8, 2022
fcac539
add basic tests
attack68 Jan 9, 2022
55010b5
add basic tests
attack68 Jan 9, 2022
9500c06
extend docs
attack68 Jan 9, 2022
38ea09c
mypy fix
attack68 Jan 9, 2022
86287a4
Merge remote-tracking branch 'upstream/master' into styler_format_ali…
attack68 Jan 9, 2022
f48b43c
whats new
attack68 Jan 9, 2022
9bcc320
doctest skip
attack68 Jan 10, 2022
a4b5c9a
fix tests
attack68 Jan 10, 2022
720d1b3
fix tests
attack68 Jan 10, 2022
7bf50c9
fix tests
attack68 Jan 10, 2022
c0925d9
fix tests
attack68 Jan 10, 2022
7731f6d
fix tests
attack68 Jan 10, 2022
908b47b
fix tests
attack68 Jan 10, 2022
7ef45ec
fix tests
attack68 Jan 10, 2022
c6b9856
test deprecated warning
attack68 Jan 11, 2022
b12baea
fix tests
attack68 Jan 11, 2022
0c3f64a
fix tests
attack68 Jan 11, 2022
99b269b
fix tests
attack68 Jan 11, 2022
3a5e64a
fix tests
attack68 Jan 11, 2022
98d80ac
fix tests
attack68 Jan 11, 2022
6f00105
fix tests
attack68 Jan 11, 2022
f704bc5
fix tests
attack68 Jan 11, 2022
888511e
fix tests
attack68 Jan 11, 2022
cce3060
edit docs
attack68 Jan 11, 2022
e31fe6b
edit docs
attack68 Jan 11, 2022
ef3f0ec
edit docs
attack68 Jan 12, 2022
ffee373
Merge remote-tracking branch 'upstream/main' into styler_to_latex_1.5
attack68 Jan 14, 2022
998a551
change formatting structure
attack68 Jan 14, 2022
9a8f069
change formatting structure
attack68 Jan 14, 2022
843eb29
version changed
attack68 Jan 15, 2022
3069db0
spell
attack68 Jan 15, 2022
9300345
doctest fix
attack68 Jan 15, 2022
17c6298
doctest fix
attack68 Jan 15, 2022
84445de
mypy fixes
attack68 Jan 15, 2022
a9e2f79
doc line fix
attack68 Jan 15, 2022
689282c
mypy fix
attack68 Jan 16, 2022
526cc31
Merge remote-tracking branch 'upstream/main' into styler_format_alias…
attack68 Jan 16, 2022
a6952bb
doc string fixes
attack68 Jan 16, 2022
d498254
encoding tests fixed, and printing repr tests
attack68 Jan 17, 2022
39fbcd6
comment failing tests
attack68 Jan 17, 2022
c4e9154
jinja2 tests
attack68 Jan 18, 2022
1b4b5de
jinja2 tests
attack68 Jan 19, 2022
6cf4285
jinja2 tests
attack68 Jan 19, 2022
7ac14c1
jinja2 tests
attack68 Jan 19, 2022
1167cb5
Merge remote-tracking branch 'upstream/main' into styler_to_latex_1.5
attack68 Jan 19, 2022
c7f412e
jinja2 tests
attack68 Jan 19, 2022
2a18d60
Merge remote-tracking branch 'upstream/main' into styler_format_alias…
attack68 Jan 20, 2022
84dd57b
Merge branch 'styler_format_alias_multi' into styler_to_latex_1.5
attack68 Jan 20, 2022
58a48b8
add header aliases and tests
attack68 Jan 20, 2022
1ab42b5
typing
attack68 Jan 20, 2022
150ee1d
Merge remote-tracking branch 'upstream/main' into styler_format_alias…
attack68 Jan 21, 2022
426887a
Merge branch 'styler_format_alias_multi' into styler_to_latex_1.5
attack68 Jan 21, 2022
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
mypy fixes
  • Loading branch information
attack68 committed Jan 15, 2022
commit 84445deb9d61710827797ded7d958cb9af21fc6a
26 changes: 13 additions & 13 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -3180,9 +3180,9 @@ def to_latex(
label=None,
position=None,
*,
hide: dict | list[dict] = None,
format: dict | list[dict] = None,
format_index: dict | list[dict] = None,
hide: dict | list[dict] | None = None,
format: dict | list[dict] | None = None,
format_index: dict | list[dict] | None = None,
render_kwargs: dict | None = None,
):
r"""
Expand Down Expand Up @@ -3583,12 +3583,11 @@ def _wrap(x, alt_format_):
hide.append({"names": True, "axis": "index"})

format_ = {"formatter": formatters, **base_format_}
if format is None:
data_format_ = [format_]
elif isinstance(format, dict):
data_format_ = [format_, format]
else:
data_format_ = [format_].extend(format)
data_format_ = [format_]
if isinstance(format, dict):
data_format_.append(format)
elif isinstance(format, list):
data_format_.extend(format)

render_kwargs = {
"hrules": True,
Expand Down Expand Up @@ -3621,10 +3620,10 @@ def _to_latex_via_styler(
self,
buf=None,
*,
hide: dict | list[dict] = None,
format: dict | list[dict] = None,
format_index: dict | list[dict] = None,
render_kwargs: dict | None = None,
hide: dict | list[dict] | None = None,
format: dict | list[dict] | None = None,
format_index: dict | list[dict] | None = None,
render_kwargs: dict = {},
):
"""
Render object to a LaTeX tabular, longtable, or nested table.
Expand Down Expand Up @@ -3689,6 +3688,7 @@ def _to_latex_via_styler(
"""
from pandas.io.formats.style import Styler

self = cast("DataFrame", self)
styler = Styler(
self,
uuid="",
Expand Down