Skip to content

Commit aad97dc

Browse files
carlosdanielcsantoscarlosdanielcsantos
carlosdanielcsantos
authored and
carlosdanielcsantos
committed
Updating docs
1 parent 568c12f commit aad97dc

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

doc/source/computation.rst

+11-6
Original file line numberDiff line numberDiff line change
@@ -461,18 +461,22 @@ default of the index) in a DataFrame.
461461
462462
.. _stats.rolling_window.endpoints:
463463

464-
Rolling window endpoint inclusion
465-
~~~~~~~~~~~~~~~~~~
464+
Rolling Window Endpoints
465+
~~~~~~~~~~~~~~~~~~~~~~~~
466466

467467
.. versionadded:: 0.20.0
468468

469469
The inclusion of the interval endpoints in rolling window calculations can be specified with the ``closed``
470470
parameter:
471471

472-
- ``right`` : close right endpoint (default for time-based windows)
473-
- ``left`` : close left endpoint
474-
- ``both`` : close both endpoints (default for fixed windows)
475-
- ``neither`` : open endpoints
472+
.. csv-table::
473+
:header: "``closed``", "Description", "Default for"
474+
:widths: 20, 30, 30
475+
476+
``right``, close right endpoint, time-based windows
477+
``left``, close left endpoint,
478+
``both``, close both endpoints, fixed windows
479+
``neither``, open endpoints,
476480

477481
For example, having the right endpoint open is useful in many problems that require that there is no contamination
478482
from present information back to past information. This allows the rolling window to compute statistics
@@ -495,6 +499,7 @@ from present information back to past information. This allows the rolling windo
495499
df
496500
497501
Currently, this feature is only implemented for time-based windows.
502+
For fixed windows, the closed parameter cannot be set and the rolling window will always have both endpoints closed.
498503

499504
.. _stats.moments.ts-versus-resampling:
500505

doc/source/whatsnew/v0.20.0.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -319,7 +319,7 @@ To convert a ``SparseDataFrame`` back to sparse SciPy matrix in COO format, you
319319
Other Enhancements
320320
^^^^^^^^^^^^^^^^^^
321321

322-
- ``DataFrame.rolling()`` now accepts the parameter ``closed='right'|'left'|'both'|'neither'`` to choose the rolling window endpoint closedness. See :ref:`documentation <stats.rolling_window.endpoints>` (:issue:`13965`)
322+
- ``DataFrame.rolling()`` now accepts the parameter ``closed='right'|'left'|'both'|'neither'`` to choose the rolling window endpoint closedness. See the :ref:`documentation <stats.rolling_window.endpoints>` (:issue:`13965`)
323323
- Integration with the ``feather-format``, including a new top-level ``pd.read_feather()`` and ``DataFrame.to_feather()`` method, see :ref:`here <io.feather>`.
324324
- ``Series.str.replace()`` now accepts a callable, as replacement, which is passed to ``re.sub`` (:issue:`15055`)
325325
- ``Series.str.replace()`` now accepts a compiled regular expression as a pattern (:issue:`15446`)

0 commit comments

Comments
 (0)