Skip to content

DOC: Updating Series.agg docstring #22474

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 24, 2018
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion ci/doctests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ if [ "$DOCTEST" ]; then
fi

pytest --doctest-modules -v pandas/core/series.py \
-k"-agg -map -nlargest -nonzero -nsmallest -reindex -searchsorted -to_dict"
-k"-nlargest -nonzero -nsmallest -reindex -searchsorted -to_dict"

if [ $? -ne "0" ]; then
RET=1
Expand Down
3 changes: 1 addition & 2 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4439,7 +4439,6 @@ def pipe(self, func, *args, **kwargs):
- function.
- list of functions.
- dict of column names -> functions (or list of functions).

%(axis)s
*args
Positional arguments to pass to `func`.
Expand Down Expand Up @@ -8146,7 +8145,7 @@ def mask(self, cond, other=np.nan, inplace=False, axis=None, level=None,
Parameters
----------
periods : int
Number of periods to move, can be positive or negative
Number of periods to move, can be positive or negative.
freq : DateOffset, timedelta, or time rule string, optional
Increment to use from the tseries module or time rule (e.g. 'EOM').
See Notes.
Expand Down
27 changes: 14 additions & 13 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1132,7 +1132,6 @@ def reset_index(self, level=None, drop=False, name=None, inplace=False):

Examples
--------

>>> s = pd.Series([1, 2, 3, 4], name='foo',
... index=pd.Index(['a', 'b', 'c', 'd'], name='idx'))

Expand Down Expand Up @@ -3046,21 +3045,27 @@ def _gotitem(self, key, ndim, subset=None):
Examples
--------

>>> s = pd.Series(np.random.randn(10))
>>> s = pd.Series([1, 2, 3, 4])
>>> s
0 1
1 2
2 3
3 4
dtype: int64

>>> s.agg('min')
-1.3018049988556679
1

>>> s.agg(['min', 'max'])
min -1.301805
max 1.127688
dtype: float64
min 1
max 4
dtype: int64

See also
--------
pandas.Series.apply
pandas.Series.transform

pandas.Series.apply : Invoke function on a Series.
pandas.Series.transform : Transform function producing
a Series with like indexes.
""")

@Appender(_agg_doc)
Expand Down Expand Up @@ -3315,7 +3320,6 @@ def rename(self, index=None, **kwargs):

Examples
--------

>>> s = pd.Series([1, 2, 3])
>>> s
0 1
Expand All @@ -3337,7 +3341,6 @@ def rename(self, index=None, **kwargs):
3 2
5 3
dtype: int64

"""
kwargs['inplace'] = validate_bool_kwarg(kwargs.get('inplace', False),
'inplace')
Expand Down Expand Up @@ -3507,7 +3510,6 @@ def memory_usage(self, index=True, deep=False):

Examples
--------

>>> s = pd.Series(range(3))
>>> s.memory_usage()
104
Expand Down Expand Up @@ -3591,7 +3593,6 @@ def isin(self, values):

Examples
--------

>>> s = pd.Series(['lama', 'cow', 'lama', 'beetle', 'lama',
... 'hippo'], name='animal')
>>> s.isin(['cow', 'lama'])
Expand Down