Skip to content

Commit 13ae107

Browse files
gojandrooojorisvandenbossche
authored andcommitted
DOC: update the window.Rolling.min docstring (#20263)
1 parent f7a5682 commit 13ae107

File tree

1 file changed

+32
-3
lines changed

1 file changed

+32
-3
lines changed

pandas/core/window.py

+32-3
Original file line numberDiff line numberDiff line change
@@ -910,7 +910,38 @@ def max(self, *args, **kwargs):
910910
return self._apply('roll_max', 'max', **kwargs)
911911

912912
_shared_docs['min'] = dedent("""
913-
%(name)s minimum
913+
Calculate the %(name)s minimum.
914+
915+
Parameters
916+
----------
917+
**kwargs
918+
Under Review.
919+
920+
Returns
921+
-------
922+
Series or DataFrame
923+
Returned object type is determined by the caller of the %(name)s
924+
calculation.
925+
926+
See Also
927+
--------
928+
Series.%(name)s : Calling object with a Series
929+
DataFrame.%(name)s : Calling object with a DataFrame
930+
Series.min : Similar method for Series
931+
DataFrame.min : Similar method for DataFrame
932+
933+
Examples
934+
--------
935+
Performing a rolling minimum with a window size of 3.
936+
937+
>>> s = pd.Series([4, 3, 5, 2, 6])
938+
>>> s.rolling(3).min()
939+
0 NaN
940+
1 NaN
941+
2 3.0
942+
3 2.0
943+
4 2.0
944+
dtype: float64
914945
""")
915946

916947
def min(self, *args, **kwargs):
@@ -1410,7 +1441,6 @@ def max(self, *args, **kwargs):
14101441
return super(Rolling, self).max(*args, **kwargs)
14111442

14121443
@Substitution(name='rolling')
1413-
@Appender(_doc_template)
14141444
@Appender(_shared_docs['min'])
14151445
def min(self, *args, **kwargs):
14161446
nv.validate_rolling_func('min', args, kwargs)
@@ -1671,7 +1701,6 @@ def max(self, *args, **kwargs):
16711701
return super(Expanding, self).max(*args, **kwargs)
16721702

16731703
@Substitution(name='expanding')
1674-
@Appender(_doc_template)
16751704
@Appender(_shared_docs['min'])
16761705
def min(self, *args, **kwargs):
16771706
nv.validate_expanding_func('min', args, kwargs)

0 commit comments

Comments
 (0)