Skip to content

Commit

Permalink
Document the behavior of axis=None with style.background_gradient (
Browse files Browse the repository at this point in the history
  • Loading branch information
joelostblom authored and WillAyd committed Mar 7, 2019
1 parent a07c7b9 commit 09f4484
Showing 1 changed file with 23 additions and 19 deletions.
42 changes: 23 additions & 19 deletions pandas/io/formats/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -576,10 +576,10 @@ def apply(self, func, axis=0, subset=None, **kwargs):
on ``axis``), and return an object with the same shape.
Must return a DataFrame with identical index and
column labels when ``axis=None``
axis : int, str or None
apply to each column (``axis=0`` or ``'index'``)
or to each row (``axis=1`` or ``'columns'``) or
to the entire DataFrame at once with ``axis=None``
axis : {0 or 'index', 1 or 'columns', None}, default 0
apply to each column (``axis=0`` or ``'index'``), to each row
(``axis=1`` or ``'columns'``), or to the entire DataFrame at once
with ``axis=None``.
subset : IndexSlice
a valid indexer to limit ``data`` to *before* applying the
function. Consider using a pandas.IndexSlice
Expand Down Expand Up @@ -894,10 +894,12 @@ def background_gradient(self, cmap='PuBu', low=0, high=0, axis=0,
matplotlib colormap
low, high : float
compress the range by these values.
axis : int or str
1 or 'columns' for columnwise, 0 or 'index' for rowwise
axis : {0 or 'index', 1 or 'columns', None}, default 0
apply to each column (``axis=0`` or ``'index'``), to each row
(``axis=1`` or ``'columns'``), or to the entire DataFrame at once
with ``axis=None``.
subset : IndexSlice
a valid slice for ``data`` to limit the style application to
a valid slice for ``data`` to limit the style application to.
text_color_threshold : float or int
luminance threshold for determining text color. Facilitates text
visibility across varying background colors. From 0 to 1.
Expand Down Expand Up @@ -1081,10 +1083,10 @@ def bar(self, subset=None, axis=0, color='#d65f5f', width=100,
----------
subset : IndexSlice, optional
A valid slice for `data` to limit the style application to.
axis : int, str or None, default 0
Apply to each column (`axis=0` or `'index'`)
or to each row (`axis=1` or `'columns'`) or
to the entire DataFrame at once with `axis=None`.
axis : {0 or 'index', 1 or 'columns', None}, default 0
apply to each column (``axis=0`` or ``'index'``), to each row
(``axis=1`` or ``'columns'``), or to the entire DataFrame at once
with ``axis=None``.
color : str or 2-tuple/list
If a str is passed, the color is the same for both
negative and positive numbers. If 2-tuple/list is used, the
Expand Down Expand Up @@ -1149,11 +1151,12 @@ def highlight_max(self, subset=None, color='yellow', axis=0):
Parameters
----------
subset : IndexSlice, default None
a valid slice for ``data`` to limit the style application to
a valid slice for ``data`` to limit the style application to.
color : str, default 'yellow'
axis : int, str, or None; default 0
0 or 'index' for columnwise (default), 1 or 'columns' for rowwise,
or ``None`` for tablewise
axis : {0 or 'index', 1 or 'columns', None}, default 0
apply to each column (``axis=0`` or ``'index'``), to each row
(``axis=1`` or ``'columns'``), or to the entire DataFrame at once
with ``axis=None``.
Returns
-------
Expand All @@ -1169,11 +1172,12 @@ def highlight_min(self, subset=None, color='yellow', axis=0):
Parameters
----------
subset : IndexSlice, default None
a valid slice for ``data`` to limit the style application to
a valid slice for ``data`` to limit the style application to.
color : str, default 'yellow'
axis : int, str, or None; default 0
0 or 'index' for columnwise (default), 1 or 'columns' for rowwise,
or ``None`` for tablewise
axis : {0 or 'index', 1 or 'columns', None}, default 0
apply to each column (``axis=0`` or ``'index'``), to each row
(``axis=1`` or ``'columns'``), or to the entire DataFrame at once
with ``axis=None``.
Returns
-------
Expand Down

0 comments on commit 09f4484

Please sign in to comment.