Skip to content

DOC: a few touchups #11663

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 1 commit into from
Nov 20, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion doc/source/api.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1710,7 +1710,7 @@ Style Export and Import

Styler.render
Styler.export
Styler.set
Styler.use

.. currentmodule:: pandas

Expand Down
22 changes: 13 additions & 9 deletions pandas/core/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,11 +68,11 @@ class Styler(object):
Notes
-----
Most styling will be done by passing style functions into
Styler.apply or Styler.applymap. Style functions should
return values with strings containing CSS 'attr: value' that will
``Styler.apply`` or ``Styler.applymap``. Style functions should
return values with strings containing CSS ``'attr: value'`` that will
be applied to the indicated cells.

If using in the Jupyter notebook, Styler has defined a _repr_html_
If using in the Jupyter notebook, Styler has defined a ``_repr_html_``
to automatically render itself. Otherwise call Styler.render to get
the genterated HTML.

Expand Down Expand Up @@ -306,6 +306,10 @@ def __deepcopy__(self, memo):
return self._copy(deepcopy=True)

def clear(self):
'''
"Reset" the styler, removing any previously applied styles.
Returns None.
'''
self.ctx.clear()
self._todo = []

Expand Down Expand Up @@ -360,9 +364,9 @@ def apply(self, func, axis=0, subset=None, **kwargs):

Notes
-----
This is similar to DataFrame.apply, except that axis=None applies
the function to the entire DataFrame at once, rather tha column
or rowwise.
This is similar to ``DataFrame.apply``, except that ``axis=None``
applies the function to the entire DataFrame at once,
rather than column-wise or row-wise.
"""
self._todo.append((lambda instance: getattr(instance, '_apply'),
(func, axis, subset),
Expand Down Expand Up @@ -424,7 +428,7 @@ def set_precision(self, precision):
def set_table_attributes(self, attributes):
"""
Set the table attributes. These are the items
that show up in the opening <table> tag in addition
that show up in the opening ``<table>`` tag in addition
to to automatic (by default) id.

.. versionadded:: 0.17.1
Expand All @@ -443,7 +447,7 @@ def set_table_attributes(self, attributes):
def export(self):
"""
Export the styles to applied to the current Styler.
Can be applied to a second style with `.use`.
Can be applied to a second style with ``Styler.use``.

.. versionadded:: 0.17.1

Expand All @@ -460,7 +464,7 @@ def export(self):
def use(self, styles):
"""
Set the styles on the current Styler, possibly using styles
from `Styler.export`
from ``Styler.export``.

.. versionadded:: 0.17.1

Expand Down