From 6df97d801b2ea829b98606e1f481bb170f416b31 Mon Sep 17 00:00:00 2001 From: Tom Augspurger Date: Fri, 20 Nov 2015 09:33:14 -0600 Subject: [PATCH] DOC: a few touchups --- doc/source/api.rst | 2 +- pandas/core/style.py | 22 +++++++++++++--------- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/doc/source/api.rst b/doc/source/api.rst index 668e297dc8f18..ac79528f31e04 100644 --- a/doc/source/api.rst +++ b/doc/source/api.rst @@ -1710,7 +1710,7 @@ Style Export and Import Styler.render Styler.export - Styler.set + Styler.use .. currentmodule:: pandas diff --git a/pandas/core/style.py b/pandas/core/style.py index 2559b9a3a5dc2..550b0f16eabb7 100644 --- a/pandas/core/style.py +++ b/pandas/core/style.py @@ -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. @@ -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 = [] @@ -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), @@ -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 tag in addition + that show up in the opening ``
`` tag in addition to to automatic (by default) id. .. versionadded:: 0.17.1 @@ -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 @@ -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