From 447580e492271228c8e777757934ae5fd7af9515 Mon Sep 17 00:00:00 2001 From: alimcmaster1 Date: Fri, 24 Aug 2018 08:28:06 +0100 Subject: [PATCH] DOC: Updating Series.agg docstring (#22474) --- ci/doctests.sh | 2 +- pandas/core/generic.py | 3 +-- pandas/core/series.py | 27 ++++++++++++++------------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/ci/doctests.sh b/ci/doctests.sh index fee33a0f93f40..2af5dbd26aeb1 100755 --- a/ci/doctests.sh +++ b/ci/doctests.sh @@ -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 diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 0e5204fcd6524..85bd6065314f4 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -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`. @@ -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. diff --git a/pandas/core/series.py b/pandas/core/series.py index 4558314d612d0..ab41954990412 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -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')) @@ -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) @@ -3315,7 +3320,6 @@ def rename(self, index=None, **kwargs): Examples -------- - >>> s = pd.Series([1, 2, 3]) >>> s 0 1 @@ -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') @@ -3507,7 +3510,6 @@ def memory_usage(self, index=True, deep=False): Examples -------- - >>> s = pd.Series(range(3)) >>> s.memory_usage() 104 @@ -3591,7 +3593,6 @@ def isin(self, values): Examples -------- - >>> s = pd.Series(['lama', 'cow', 'lama', 'beetle', 'lama', ... 'hippo'], name='animal') >>> s.isin(['cow', 'lama'])