Skip to content

Commit aaadd2d

Browse files
committed
DOC: Various doc fixes
- Fixed spacing - Fixed method reference - Fixed list line wrapping - Fixed unbalanced ticks - Fixed section-heading without colon - Changed Interval Properties -> Attributes - Changed Styler properties
1 parent 89bd268 commit aaadd2d

File tree

4 files changed

+40
-22
lines changed

4 files changed

+40
-22
lines changed

doc/source/whatsnew/v0.20.0.txt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,7 @@ The following are now part of this API:
176176
``pandas.testing``
177177
^^^^^^^^^^^^^^^^^^
178178

179-
We are adding a standard module that exposes the public testing functions in ``pandas.testing``(:issue:`9895`). Those functions can be used when writing tests for functionality using pandas objects.
179+
We are adding a standard module that exposes the public testing functions in ``pandas.testing`` (:issue:`9895`). Those functions can be used when writing tests for functionality using pandas objects.
180180

181181
The following testing functions are now part of this API:
182182

@@ -515,7 +515,7 @@ Other Enhancements
515515
- ``pandas.io.json.json_normalize()`` gained the option ``errors='ignore'|'raise'``; the default is ``errors='raise'`` which is backward compatible. (:issue:`14583`)
516516
- ``pandas.io.json.json_normalize()`` with an empty ``list`` will return an empty ``DataFrame`` (:issue:`15534`)
517517
- ``pandas.io.json.json_normalize()`` has gained a ``sep`` option that accepts ``str`` to separate joined fields; the default is ".", which is backward compatible. (:issue:`14883`)
518-
- :method:`~MultiIndex.remove_unused_levels` has been added to facilitate :ref:`removing unused levels <advanced.shown_levels>`. (:issue:`15694`)
518+
- :meth:`~MultiIndex.remove_unused_levels` has been added to facilitate :ref:`removing unused levels <advanced.shown_levels>`. (:issue:`15694`)
519519
- ``pd.read_csv()`` will now raise a ``ParserError`` error whenever any parsing error occurs (:issue:`15913`, :issue:`15925`)
520520
- ``pd.read_csv()`` now supports the ``error_bad_lines`` and ``warn_bad_lines`` arguments for the Python parser (:issue:`15925`)
521521
- ``parallel_coordinates()`` has gained a ``sort_labels`` keyword arg that sorts class labels and the colours assigned to them (:issue:`15908`)
@@ -616,8 +616,8 @@ However, ``.agg(..)`` can *also* accept a dict that allows 'renaming' of the res
616616
between ``Series`` and ``DataFrame``. We are deprecating this 'renaming' functionaility.
617617

618618
- We are deprecating passing a dict to a grouped/rolled/resampled ``Series``. This allowed
619-
one to ``rename`` the resulting aggregation, but this had a completely different
620-
meaning than passing a dictionary to a grouped ``DataFrame``, which accepts column-to-aggregations.
619+
one to ``rename`` the resulting aggregation, but this had a completely different
620+
meaning than passing a dictionary to a grouped ``DataFrame``, which accepts column-to-aggregations.
621621
- We are deprecating passing a dict-of-dicts to a grouped/rolled/resampled ``DataFrame`` in a similar manner.
622622

623623
This is an illustrative example:
@@ -1357,9 +1357,9 @@ If indicated, a deprecation warning will be issued if you reference theses modul
13571357
"pandas._testing", "pandas.util.libtesting", ""
13581358
"pandas._window", "pandas.core.libwindow", ""
13591359

1360-
- The function :func:`~pandas.api.type.union_categoricals` is now importable from ``pandas.api.types``, formerly from ``pandas.types.concat`` (:issue:`15998`)
1360+
- The function :func:`~pandas.api.type.union_categoricals` is now importable from ``pandas.api.types``, formerly from ```pandas.types.concat`` (:issue:`15998`)
13611361

1362-
.. _whatsnew_0200.privacy.deprecate_plotting
1362+
.. _whatsnew_0200.privacy.deprecate_plotting:
13631363

13641364
Deprecate .plotting
13651365
^^^^^^^^^^^^^^^^^^^

pandas/_libs/interval.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ cdef class Interval(IntervalMixin):
5252
5353
.. versionadded:: 0.20.0
5454
55-
Properties
55+
Attributes
5656
----------
5757
left, right : values
5858
Left and right bounds for each interval.

pandas/core/generic.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4210,14 +4210,14 @@ def groupby(self, by=None, axis=0, level=None, as_index=True, sort=True,
42104210
42114211
Parameters
42124212
----------
4213-
by : mapping function / list of functions, dict, Series, ndarray,
4214-
or tuple / list of column names or index level names or
4215-
Series or ndarrays
4216-
Called on each element of the object index to determine the groups.
4217-
If a dict or Series is passed, the Series or dict VALUES will be
4218-
used to determine the groups (the Series' values are first
4219-
aligned; see ``.align()`` method). If ndarray is passed, the
4220-
values as-is determine the groups.
4213+
by : mapping, function, str, or iterable
4214+
Used to determine the groups for the groupby.
4215+
If ``by`` is a function, it's called on each value of the object's
4216+
index. If a dict or Series is passed, the Series or dict VALUES
4217+
will be used to determine the groups (the Series' values are first
4218+
aligned; see ``.align()`` method). If an ndarray is passed, the
4219+
values as-is determine the groups. A str or list of strs maybe be
4220+
used used to group by the columns in ``self``.
42214221
axis : int, default 0
42224222
level : int, level name, or sequence of such, default None
42234223
If the axis is a MultiIndex (hierarchical), group by a particular

pandas/io/formats/style.py

Lines changed: 25 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ class Styler(object):
7070
7171
Attributes
7272
----------
73-
env : Jinja2 Environment
74-
template: Jinja2 Template
75-
loader : Jinja2 Loader
73+
env
74+
template
75+
loader
7676
7777
Notes
7878
-----
@@ -107,12 +107,30 @@ class Styler(object):
107107
--------
108108
pandas.DataFrame.style
109109
"""
110-
loader = PackageLoader("pandas", "io/formats/templates")
111-
env = Environment(
112-
loader=loader,
110+
_loader = PackageLoader("pandas", "io/formats/templates")
111+
_env = Environment(
112+
loader=_loader,
113113
trim_blocks=True,
114114
)
115-
template = env.get_template("html.tpl")
115+
_template = _env.get_template("html.tpl")
116+
117+
@property
118+
def template(self):
119+
"""Jinja2 template
120+
121+
See :ref:`see the example notebook <style.ipynb#Subclassing>` for more
122+
"""
123+
return self._template
124+
125+
@property
126+
def loader(self):
127+
"""Jinja2 Loader to load the templates shipped with pandas"""
128+
return self._loader
129+
130+
@property
131+
def env(self):
132+
"""Jinja2 Environment with the loader for pandas' templates"""
133+
return self._env
116134

117135
def __init__(self, data, precision=None, table_styles=None, uuid=None,
118136
caption=None, table_attributes=None):

0 commit comments

Comments
 (0)