Skip to content

Commit 0bbe110

Browse files
committed
DOC: minor doc corrections
1 parent 3156395 commit 0bbe110

File tree

6 files changed

+379
-297
lines changed

6 files changed

+379
-297
lines changed

doc/source/computation.rst

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ and kurtosis.
220220

221221
.. note::
222222

223-
The API for window statistics is quite similar to the way one works with ``Groupby`` objects, see the documentation :ref:`here <groupby>`
223+
The API for window statistics is quite similar to the way one works with ``GroupBy`` objects, see the documentation :ref:`here <groupby>`
224224

225225
We work with ``rolling``, ``expanding`` and ``exponentially weighted`` data through the corresponding
226226
objects, :class:`~pandas.core.window.Rolling`, :class:`~pandas.core.window.Expanding` and :class:`~pandas.core.window.EWM`.
@@ -231,7 +231,7 @@ objects, :class:`~pandas.core.window.Rolling`, :class:`~pandas.core.window.Expan
231231
s = s.cumsum()
232232
s
233233
234-
These are created from methods on ``Series`` and ``DataFrames``.
234+
These are created from methods on ``Series`` and ``DataFrame``.
235235

236236
.. ipython:: python
237237
@@ -247,7 +247,7 @@ accept the following arguments:
247247
- ``freq``: optionally specify a :ref:`frequency string <timeseries.alias>`
248248
or :ref:`DateOffset <timeseries.offsets>` to pre-conform the data to.
249249

250-
We can then call functions on these ``rolling`` objects. Which return like-indexed objects:
250+
We can then call methods on these ``rolling`` objects. These return like-indexed objects:
251251

252252
.. ipython:: python
253253
@@ -304,8 +304,6 @@ We provide a number of the common statistical functions:
304304
:meth:`~Rolling.apply`, Generic apply
305305
:meth:`~Rolling.cov`, Unbiased covariance (binary)
306306
:meth:`~Rolling.corr`, Correlation (binary)
307-
:meth:`~Window.mean`, Moving window mean function
308-
:meth:`~Window.sum`, Moving window sum function
309307

310308
The :meth:`~Rolling.apply` function takes an extra ``func`` argument and performs
311309
generic rolling computations. The ``func`` argument should be a single function
@@ -323,9 +321,17 @@ compute the mean absolute deviation on a rolling basis:
323321
Rolling Windows
324322
~~~~~~~~~~~~~~~
325323

326-
The :meth:`~Window.mean`, and :meth:`~Window.sum` functions perform a generic rolling window computation
327-
on the input data. The weights used in the window are specified by the ``win_type``
328-
keyword. The list of recognized types are:
324+
Passing ``win_type`` to ``.rolling`` generates a generic rolling window computation, that is weighted according the ``win_type``.
325+
The following methods are available:
326+
327+
.. csv-table::
328+
:header: "Method", "Description"
329+
:widths: 20, 80
330+
331+
:meth:`~Window.sum`, Sum of values
332+
:meth:`~Window.mean`, Mean of values
333+
334+
The weights used in the window are specified by the ``win_type``keyword. The list of recognized types are:
329335
330336
- ``boxcar``
331337
- ``triang``
@@ -484,9 +490,9 @@ We can aggregate by passing a function to the entire DataFrame, or select a Seri
484490
485491
r['A'].aggregate(np.sum)
486492
487-
r['A','B'].aggregate(np.sum)
493+
r[['A','B']].aggregate(np.sum)
488494
489-
As you can see, the result of the aggregation will have the selection columns, or all
495+
As you can see, the result of the aggregation will have the selected columns, or all
490496
columns if none are selected.
491497

492498
.. _stats.aggregate.multifunc:
@@ -531,7 +537,7 @@ columns of a DataFrame:
531537
'B' : lambda x: np.std(x, ddof=1)})
532538
533539
The function names can also be strings. In order for a string to be valid it
534-
must be either implemented on the Windowed object
540+
must be implemented on the Windowed object
535541

536542
.. ipython:: python
537543

pandas/core/base.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -361,8 +361,8 @@ def _gotitem(self, key, ndim, subset=None):
361361
362362
See also
363363
--------
364-
:func:`pandas.Series.%(name)s`
365-
:func:`pandas.DataFrame.%(name)s`
364+
`pandas.Series.%(name)s`
365+
`pandas.DataFrame.%(name)s`
366366
"""
367367

368368
def aggregate(self, func, *args, **kwargs):
@@ -465,9 +465,9 @@ def _aggregate_multiple_funcs(self, arg, _level):
465465
# find a good name, this could be a function that we don't recognize
466466
name = self._is_cython_func(a) or a
467467
if not isinstance(name, compat.string_types):
468-
name = getattr(a,name,a)
468+
name = getattr(a,'name',a)
469469
if not isinstance(name, compat.string_types):
470-
name = getattr(a,func_name,a)
470+
name = getattr(a,'__name__',a)
471471

472472
keys.append(name)
473473
except (TypeError, DataError):

0 commit comments

Comments
 (0)