Skip to content
Merged
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
35 changes: 32 additions & 3 deletions pandas/core/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -910,7 +910,38 @@ def max(self, *args, **kwargs):
return self._apply('roll_max', 'max', **kwargs)

_shared_docs['min'] = dedent("""
%(name)s minimum
Calculate the %(name)s minimum.

Parameters
----------
**kwargs
Under Review.

Returns
-------
Series or DataFrame
Returned object type is determined by the caller of the %(name)s
calculation.

See Also
--------
Series.%(name)s : Calling object with a Series
DataFrame.%(name)s : Calling object with a DataFrame
Series.min : Similar method for Series
DataFrame.min : Similar method for DataFrame

Examples
--------
Performing a rolling minimum with a window size of 3.

>>> s = pd.Series([4, 3, 5, 2, 6])
>>> s.rolling(3).min()
0 NaN
1 NaN
2 3.0
3 2.0
4 2.0
dtype: float64
""")

def min(self, *args, **kwargs):
Expand Down Expand Up @@ -1410,7 +1441,6 @@ def max(self, *args, **kwargs):
return super(Rolling, self).max(*args, **kwargs)

@Substitution(name='rolling')
@Appender(_doc_template)
@Appender(_shared_docs['min'])
def min(self, *args, **kwargs):
nv.validate_rolling_func('min', args, kwargs)
Expand Down Expand Up @@ -1671,7 +1701,6 @@ def max(self, *args, **kwargs):
return super(Expanding, self).max(*args, **kwargs)

@Substitution(name='expanding')
@Appender(_doc_template)
@Appender(_shared_docs['min'])
def min(self, *args, **kwargs):
nv.validate_expanding_func('min', args, kwargs)
Expand Down