From 2c4455cc1caf6932ab764555681cb79e62611e36 Mon Sep 17 00:00:00 2001 From: thoo Date: Sun, 3 Feb 2019 22:59:06 -0500 Subject: [PATCH 01/24] Fix validation error RT05 --- ci/code_checks.sh | 4 ++-- pandas/core/algorithms.py | 6 +++--- pandas/core/arrays/categorical.py | 4 ++-- pandas/core/arrays/datetimelike.py | 8 ++++---- pandas/core/frame.py | 2 +- pandas/core/generic.py | 20 ++++++++++---------- pandas/core/indexes/base.py | 22 +++++++++++----------- pandas/core/indexes/multi.py | 12 ++++++------ pandas/core/panel.py | 6 +++--- pandas/core/reshape/melt.py | 2 +- pandas/core/series.py | 4 ++-- pandas/core/tools/numeric.py | 2 +- pandas/core/window.py | 2 +- pandas/io/formats/style.py | 4 ++-- pandas/plotting/_core.py | 10 +++++----- pandas/plotting/_misc.py | 2 +- pandas/tseries/frequencies.py | 2 +- 17 files changed, 56 insertions(+), 56 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index f71d2ce68f800..afb00b00e82d2 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -240,8 +240,8 @@ fi ### DOCSTRINGS ### if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then - MSG='Validate docstrings (GL06, GL07, GL09, SS04, PR03, PR05, EX04)' ; echo $MSG - $BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR05,EX04 + MSG='Validate docstrings (GL06, GL07, GL09, SS04, PR03, PR05, EX04, RT05)' ; echo $MSG + $BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR05,EX04,RT05 RET=$(($RET + $?)) ; echo $MSG "DONE" fi diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index b473a7aef929e..6c44107800f6a 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -289,9 +289,9 @@ def unique(values): Returns ------- unique values. - - If the input is an Index, the return is an Index - - If the input is a Categorical dtype, the return is a Categorical - - If the input is a Series/ndarray, the return will be an ndarray + - If the input is an Index, the return is an Index. + - If the input is a Categorical dtype, the return is a Categorical. + - If the input is a Series/ndarray, the return will be an ndarray. See Also -------- diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 6259ead5ed93e..d143b02772910 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -1292,7 +1292,7 @@ def __array__(self, dtype=None): values : numpy array A numpy array of either the specified dtype or, if dtype==None (default), the same dtype as - categorical.categories.dtype + categorical.categories.dtype . """ ret = take_1d(self.categories.values, self._codes) if dtype and not is_dtype_equal(dtype, self.categories.dtype): @@ -1501,7 +1501,7 @@ def get_values(self): ------- values : numpy array A numpy array of the same dtype as categorical.categories.dtype or - Index if datetime / periods + Index if datetime / periods. """ # if we are a datetime and period index, return Index to keep metadata if is_datetimelike(self.categories): diff --git a/pandas/core/arrays/datetimelike.py b/pandas/core/arrays/datetimelike.py index 73e799f9e0a36..5bdf59158228d 100644 --- a/pandas/core/arrays/datetimelike.py +++ b/pandas/core/arrays/datetimelike.py @@ -144,7 +144,7 @@ def strftime(self, date_format): Return an Index of formatted strings specified by date_format, which supports the same string format as the python standard library. Details of the string format can be found in `python string format - doc <%(URL)s>`__ + doc <%(URL)s>`__ . Parameters ---------- @@ -154,7 +154,7 @@ def strftime(self, date_format): Returns ------- Index - Index of formatted strings + Index of formatted strings. See Also -------- @@ -748,7 +748,7 @@ def _maybe_mask_results(self, result, fill_value=iNaT, convert=None): mask the result if needed, convert to the provided dtype if its not None - This is an internal routine + This is an internal routine. """ if self._hasnans: @@ -1047,7 +1047,7 @@ def _sub_period_array(self, other): Returns ------- result : np.ndarray[object] - Array of DateOffset objects; nulls represented by NaT + Array of DateOffset objects; nulls represented by NaT. """ if not is_period_dtype(self): raise TypeError("cannot subtract {dtype}-dtype from {cls}" diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 152d2741e1788..6bdf0cfe98929 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -2797,7 +2797,7 @@ def set_value(self, index, col, value, takeable=False): ------- frame : DataFrame If label pair is contained, will be reference to calling DataFrame, - otherwise a new object + otherwise a new object. """ warnings.warn("set_value is deprecated and will be removed " "in a future release. Please use " diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 0312ed6ecf3bf..bbcc739375695 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -4951,10 +4951,10 @@ def pipe(self, func, *args, **kwargs): Returns ------- DataFrame, Series or scalar - if DataFrame.agg is called with a single function, returns a Series - if DataFrame.agg is called with several functions, returns a DataFrame - if Series.agg is called with single function, returns a scalar - if Series.agg is called with several functions, returns a Series + - If DataFrame.agg is called with a single function, returns a Series. + - If DataFrame.agg is called with several functions, returns a DataFrame. + - If Series.agg is called with single function, returns a scalar. + - If Series.agg is called with several functions, returns a Series. %(see_also)s @@ -5350,7 +5350,7 @@ def get_values(self): Returns ------- numpy.ndarray - Numpy representation of DataFrame + Numpy representation of DataFrame. See Also -------- @@ -5429,7 +5429,7 @@ def get_ftype_counts(self): ------- dtype : Series Series with the count of columns with each type and - sparsity (dense/sparse) + sparsity (dense/sparse). See Also -------- @@ -6658,7 +6658,7 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None, ------- Series or DataFrame Returns the same object type as the caller, interpolated at - some or all ``NaN`` values + some or all ``NaN`` values. See Also -------- @@ -6882,7 +6882,7 @@ def asof(self, where, subset=None): * Series: when `self` is a Series and `where` is an array-like, or when `self` is a DataFrame and `where` is a scalar * DataFrame : when `self` is a DataFrame and `where` is an - array-like + array-like. See Also -------- @@ -7236,7 +7236,7 @@ def clip(self, lower=None, upper=None, axis=None, inplace=False, ------- Series or DataFrame Same type as calling object with the values outside the - clip boundaries replaced + clip boundaries replaced. Examples -------- @@ -8387,7 +8387,7 @@ def ranker(data): Returns ------- (left, right) : (%(klass)s, type of other) - Aligned objects + Aligned objects. """) @Appender(_shared_docs['align'] % _shared_doc_kwargs) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 2fa034670e885..c7456b1257a49 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -1556,11 +1556,11 @@ def droplevel(self, level=0): Returns ------- grouper : Index - Index of values to group on + Index of values to group on. labels : ndarray of int or None - Array of locations in level_index + Array of locations in level_index. uniques : Index or None - Index of unique values for level + Index of unique values for level. """ @Appender(_index_shared_docs['_get_grouper_for_level']) @@ -1828,7 +1828,7 @@ def isna(self): Returns ------- numpy.ndarray - A boolean array of whether my values are NA + A boolean array of whether my values are NA. See Also -------- @@ -2972,7 +2972,7 @@ def _convert_listlike_indexer(self, keyarr, kind=None): ------- tuple (indexer, keyarr) indexer is an ndarray or None if cannot convert - keyarr are tuple-safe keys + keyarr are tuple-safe keys. """ if isinstance(keyarr, Index): keyarr = self._convert_index_indexer(keyarr) @@ -3098,9 +3098,9 @@ def reindex(self, target, method=None, level=None, limit=None, Returns ------- new_index : pd.Index - Resulting index + Resulting index. indexer : np.ndarray or None - Indices of output values in original index + Indices of output values in original index. """ # GH6552: preserve names when reindexing to non-named target @@ -3156,9 +3156,9 @@ def _reindex_non_unique(self, target): Returns ------- new_index : pd.Index - Resulting index + Resulting index. indexer : np.ndarray or None - Indices of output values in original index + Indices of output values in original index. """ @@ -4259,7 +4259,7 @@ def shift(self, periods=1, freq=None): Returns ------- pandas.Index - shifted index + Shifted index. See Also -------- @@ -4422,7 +4422,7 @@ def set_value(self, arr, key, value): in the target are marked by -1. missing : ndarray of int An indexer into the target of the values not found. - These correspond to the -1 in the indexer array + These correspond to the -1 in the indexer array. """ @Appender(_index_shared_docs['get_indexer_non_unique'] % _index_doc_kwargs) diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index 14975dbbefa63..78aaa043094b8 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -61,7 +61,7 @@ def _codes_to_ints(self, codes): Returns ------ int_keys : scalar or 1-dimensional array, of dtype uint64 - Integer(s) representing one combination (each) + Integer(s) representing one combination (each). """ # Shift the representation of each level by the pre-calculated number # of bits: @@ -101,7 +101,7 @@ def _codes_to_ints(self, codes): Returns ------ int_keys : int, or 1-dimensional array of dtype object - Integer(s) representing one combination (each) + Integer(s) representing one combination (each). """ # Shift the representation of each level by the pre-calculated number @@ -1956,7 +1956,7 @@ def swaplevel(self, i=-2, j=-1): Returns ------- MultiIndex - A new MultiIndex + A new MultiIndex. .. versionchanged:: 0.18.1 @@ -2053,9 +2053,9 @@ def sortlevel(self, level=0, ascending=True, sort_remaining=True): Returns ------- sorted_index : pd.MultiIndex - Resulting index + Resulting index. indexer : np.ndarray - Indices of output values in original index + Indices of output values in original index. """ from pandas.core.sorting import indexer_from_factorized @@ -2189,7 +2189,7 @@ def reindex(self, target, method=None, level=None, limit=None, new_index : pd.MultiIndex Resulting index indexer : np.ndarray or None - Indices of output values in original index + Indices of output values in original index. """ # GH6552: preserve names when reindexing to non-named target diff --git a/pandas/core/panel.py b/pandas/core/panel.py index 540192d1a592c..2498019127c73 100644 --- a/pandas/core/panel.py +++ b/pandas/core/panel.py @@ -539,7 +539,7 @@ def set_value(self, *args, **kwargs): ------- panel : Panel If label combo is contained, will be reference to calling Panel, - otherwise a new object + otherwise a new object. """ warnings.warn("set_value is deprecated and will be removed " "in a future release. Please use " @@ -802,7 +802,7 @@ def major_xs(self, key): Returns ------- y : DataFrame - index -> minor axis, columns -> items + index -> minor axis, columns -> items. Notes ----- @@ -826,7 +826,7 @@ def minor_xs(self, key): Returns ------- y : DataFrame - index -> major axis, columns -> items + index -> major axis, columns -> items. Notes ----- diff --git a/pandas/core/reshape/melt.py b/pandas/core/reshape/melt.py index 312a108ad3380..0fa80de812c5f 100644 --- a/pandas/core/reshape/melt.py +++ b/pandas/core/reshape/melt.py @@ -230,7 +230,7 @@ def wide_to_long(df, stubnames, i, j, sep="", suffix=r'\d+'): ------- DataFrame A DataFrame that contains each stub name as a variable, with new index - (i, j) + (i, j). Notes ----- diff --git a/pandas/core/series.py b/pandas/core/series.py index e8c6cf9096948..c24c4d0c0b6f4 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -1209,7 +1209,7 @@ def set_value(self, label, value, takeable=False): ------- series : Series If label is contained, will be reference to calling Series, - otherwise a new object + otherwise a new object. """ warnings.warn("set_value is deprecated and will be removed " "in a future release. Please use " @@ -1629,7 +1629,7 @@ def unique(self): * Datetime with Timezone * Interval * Sparse - * IntegerNA + * IntegerNA . See Also -------- diff --git a/pandas/core/tools/numeric.py b/pandas/core/tools/numeric.py index 24f3e6753e500..7c58727758b0c 100644 --- a/pandas/core/tools/numeric.py +++ b/pandas/core/tools/numeric.py @@ -59,7 +59,7 @@ def to_numeric(arg, errors='raise', downcast=None): Returns ------- ret : numeric if parsing succeeded. - Return type depends on input. Series if Series, otherwise ndarray + Return type depends on input. Series if Series, otherwise ndarray. See Also -------- diff --git a/pandas/core/window.py b/pandas/core/window.py index 5556a01307a7e..99a800657638f 100644 --- a/pandas/core/window.py +++ b/pandas/core/window.py @@ -1271,7 +1271,7 @@ def skew(self, **kwargs): ------- Series or DataFrame Returned object type is determined by the caller of the %(name)s - calculation + calculation. See Also -------- diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index 61862ee0028d3..179a02edd4669 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -433,7 +433,7 @@ def render(self, **kwargs): Returns ------- rendered : str - the rendered HTML + The rendered HTML. Notes ----- @@ -1223,7 +1223,7 @@ def from_custom_template(cls, searchpath, name): Returns ------- MyStyler : subclass of Styler - has the correct ``env`` and ``template`` class attributes set. + Has the correct ``env`` and ``template`` class attributes set. """ loader = ChoiceLoader([ FileSystemLoader(searchpath), diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index 85549bafa8dc0..28dc9a4b95e07 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -2056,12 +2056,12 @@ def plot_series(data, kind='line', ax=None, # Series unique * 'axes' : object of class matplotlib.axes.Axes * 'dict' : dict of matplotlib.lines.Line2D objects - * 'both' : a namedtuple with structure (ax, lines) + * 'both' : a namedtuple with structure (ax, lines). For data grouped with ``by``: * :class:`~pandas.Series` - * :class:`~numpy.array` (for ``return_type = None``) + * :class:`~numpy.array` (for ``return_type = None``). See Also -------- @@ -2885,7 +2885,7 @@ def area(self, **kwds): Returns ------- - axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them + axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them. """ return self(kind='area', **kwds) @@ -2901,7 +2901,7 @@ def pie(self, **kwds): Returns ------- - axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them + axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them. """ return self(kind='pie', **kwds) @@ -3332,7 +3332,7 @@ def area(self, x=None, y=None, **kwds): Returns ------- matplotlib.axes.Axes or numpy.ndarray - Area plot, or array of area plots if subplots is True + Area plot, or array of area plots if subplots is True. See Also -------- diff --git a/pandas/plotting/_misc.py b/pandas/plotting/_misc.py index 1c69c03025e00..6a6235f07b63b 100644 --- a/pandas/plotting/_misc.py +++ b/pandas/plotting/_misc.py @@ -390,7 +390,7 @@ def bootstrap_plot(series, fig=None, size=50, samples=500, **kwds): Returns ------- fig : matplotlib.figure.Figure - Matplotlib figure + Matplotlib figure. See Also -------- diff --git a/pandas/tseries/frequencies.py b/pandas/tseries/frequencies.py index c454db3bbdffc..ff35f6c7a98e1 100644 --- a/pandas/tseries/frequencies.py +++ b/pandas/tseries/frequencies.py @@ -68,7 +68,7 @@ def to_offset(freq): Returns ------- delta : DateOffset - None if freq is None + None if freq is None. Raises ------ From c87102f81df3ec5eb5fc82fb1829e50cd37be2ae Mon Sep 17 00:00:00 2001 From: thoo Date: Mon, 4 Feb 2019 00:10:34 -0500 Subject: [PATCH 02/24] Fix pep8 --- pandas/core/generic.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index bbcc739375695..c2a53a40dbc9f 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -4952,7 +4952,8 @@ def pipe(self, func, *args, **kwargs): ------- DataFrame, Series or scalar - If DataFrame.agg is called with a single function, returns a Series. - - If DataFrame.agg is called with several functions, returns a DataFrame. + - If DataFrame.agg is called with several functions, returns + a DataFrame. - If Series.agg is called with single function, returns a scalar. - If Series.agg is called with several functions, returns a Series. From 03aaa92b24c44d42dcdae5c6aeb4ff9b0aa3d8da Mon Sep 17 00:00:00 2001 From: thoo Date: Mon, 4 Feb 2019 10:39:05 -0500 Subject: [PATCH 03/24] fix merge conflict --- pandas/core/generic.py | 2 +- pandas/core/panel.py | 10 ++-------- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 49030cb22cbd6..6cfee6a7fcd00 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -6882,7 +6882,7 @@ def asof(self, where, subset=None): Scalar : when `self` is a Series and `where` is a scalar Series: when `self` is a Series and `where` is an array-like, or when `self` is a DataFrame and `where` is a scalar - * DataFrame : when `self` is a DataFrame and `where` is an + DataFrame : when `self` is a DataFrame and `where` is an array-like. See Also diff --git a/pandas/core/panel.py b/pandas/core/panel.py index 78184cb5664ff..9cabd7bc32245 100644 --- a/pandas/core/panel.py +++ b/pandas/core/panel.py @@ -802,7 +802,7 @@ def major_xs(self, key): Returns ------- y : DataFrame - index -> minor axis, columns -> items. + Index -> minor axis, columns -> items. Notes ----- @@ -826,13 +826,7 @@ def minor_xs(self, key): Returns ------- y : DataFrame -<<<<<<< HEAD - index -> major axis, columns -> items. -||||||| merged common ancestors - index -> major axis, columns -> items -======= - Index -> major axis, columns -> items ->>>>>>> upstream/master + Index -> major axis, columns -> items. Notes ----- From 36a610a311c283626e690661d339036d6f5f35e4 Mon Sep 17 00:00:00 2001 From: thoo Date: Mon, 4 Feb 2019 14:08:47 -0500 Subject: [PATCH 04/24] fix RT04 --- pandas/core/algorithms.py | 7 ++++--- pandas/core/generic.py | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index 6c44107800f6a..73f58bed5ef40 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -289,9 +289,10 @@ def unique(values): Returns ------- unique values. - - If the input is an Index, the return is an Index. - - If the input is a Categorical dtype, the return is a Categorical. - - If the input is a Series/ndarray, the return will be an ndarray. + The return can be: + - If the input is an Index, the return is an Index. + - If the input is a Categorical dtype, the return is a Categorical. + - If the input is a Series/ndarray, the return will be an ndarray. See Also -------- diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 6cfee6a7fcd00..2eef6eabee0ee 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -4951,6 +4951,7 @@ def pipe(self, func, *args, **kwargs): Returns ------- DataFrame, Series or scalar + The return can be: - If DataFrame.agg is called with a single function, returns a Series. - If DataFrame.agg is called with several functions, returns a DataFrame. From c2e24b38bd0acadc3e12e3fec0698087674ed125 Mon Sep 17 00:00:00 2001 From: thoo Date: Mon, 4 Feb 2019 19:44:50 -0500 Subject: [PATCH 05/24] fix as recommended --- pandas/core/generic.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 2eef6eabee0ee..a068f6f0db370 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -4951,12 +4951,11 @@ def pipe(self, func, *args, **kwargs): Returns ------- DataFrame, Series or scalar - The return can be: - - If DataFrame.agg is called with a single function, returns a Series. - - If DataFrame.agg is called with several functions, returns - a DataFrame. - - If Series.agg is called with single function, returns a scalar. - - If Series.agg is called with several functions, returns a Series. + If DataFrame.agg is called with a single function, returns a Series.\n + If DataFrame.agg is called with several functions, returns + a DataFrame.\n + If Series.agg is called with single function, returns a scalar.\n + If Series.agg is called with several functions, returns a Series. %(see_also)s From 6e658f84568fd0da342b172b6879432b5e470a39 Mon Sep 17 00:00:00 2001 From: thoo Date: Mon, 4 Feb 2019 19:50:16 -0500 Subject: [PATCH 06/24] fix bullets --- pandas/core/algorithms.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index 73f58bed5ef40..3ef49835bb75c 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -289,10 +289,9 @@ def unique(values): Returns ------- unique values. - The return can be: - - If the input is an Index, the return is an Index. - - If the input is a Categorical dtype, the return is a Categorical. - - If the input is a Series/ndarray, the return will be an ndarray. + If the input is an Index, the return is an Index.\n + If the input is a Categorical dtype, the return is a Categorical.\n + If the input is a Series/ndarray, the return will be an ndarray. See Also -------- From 5304b9c37389be2d38f927888b4a1ed3f34ba760 Mon Sep 17 00:00:00 2001 From: thoo Date: Tue, 5 Feb 2019 20:05:54 -0500 Subject: [PATCH 07/24] fix upon suggestions --- ci/code_checks.sh | 4 +-- pandas/core/algorithms.py | 2 +- pandas/core/arrays/datetimelike.py | 2 +- pandas/plotting/_core.py | 46 +++++++++++++++--------------- pandas/plotting/_misc.py | 12 ++++---- pandas/tseries/frequencies.py | 6 ++-- 6 files changed, 36 insertions(+), 36 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 71137a6b7eeac..9b5827be7c627 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -240,8 +240,8 @@ fi ### DOCSTRINGS ### if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then - MSG='Validate docstrings (GL06, GL07, GL09, SS04, PR03, PR05, EX04, RT04, RT05, SS05)' ; echo $MSG - $BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR05,EX04,RT04,RT05,SS05 + MSG='Validate docstrings (GL06, GL07, GL09, SS04, SS05, PR03, PR05, EX04, RT04, RT05)' ; echo $MSG + $BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,SS05,PR03,PR05,EX04,RT04,RT05 RET=$(($RET + $?)) ; echo $MSG "DONE" fi diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index 3ef49835bb75c..95cfe92dcf060 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -288,7 +288,7 @@ def unique(values): Returns ------- - unique values. + unique values If the input is an Index, the return is an Index.\n If the input is a Categorical dtype, the return is a Categorical.\n If the input is a Series/ndarray, the return will be an ndarray. diff --git a/pandas/core/arrays/datetimelike.py b/pandas/core/arrays/datetimelike.py index 5bdf59158228d..94668c74c1693 100644 --- a/pandas/core/arrays/datetimelike.py +++ b/pandas/core/arrays/datetimelike.py @@ -144,7 +144,7 @@ def strftime(self, date_format): Return an Index of formatted strings specified by date_format, which supports the same string format as the python standard library. Details of the string format can be found in `python string format - doc <%(URL)s>`__ . + doc <%(URL)s>`__. Parameters ---------- diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index 28dc9a4b95e07..23f87c28102aa 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -1413,7 +1413,7 @@ def orientation(self): Returns ------- - axes : matplotlib.axes.Axes or numpy.ndarray of them + matplotlib.axes.Axes or numpy.ndarray of them See Also -------- @@ -1935,7 +1935,7 @@ def _plot(data, x=None, y=None, subplots=False, Returns ------- - axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them + :class:`matplotlib.axes.Axes` or numpy.ndarray of them Notes ----- @@ -2050,18 +2050,18 @@ def plot_series(data, kind='line', ax=None, # Series unique Returns ------- - result : + result The return type depends on the `return_type` parameter: * 'axes' : object of class matplotlib.axes.Axes * 'dict' : dict of matplotlib.lines.Line2D objects - * 'both' : a namedtuple with structure (ax, lines). + * 'both' : a namedtuple with structure (ax, lines) For data grouped with ``by``: * :class:`~pandas.Series` - * :class:`~numpy.array` (for ``return_type = None``). + * :class:`~numpy.array` (for ``return_type = None``) See Also -------- @@ -2271,7 +2271,7 @@ def scatter_plot(data, x, y, by=None, ax=None, figsize=None, grid=False, Returns ------- - fig : matplotlib.Figure + matplotlib.Figure """ import matplotlib.pyplot as plt @@ -2359,7 +2359,7 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None, Returns ------- - axes : matplotlib.AxesSubplot or numpy.ndarray of them + matplotlib.AxesSubplot or numpy.ndarray of them See Also -------- @@ -2517,7 +2517,7 @@ def grouped_hist(data, column=None, by=None, ax=None, bins=50, figsize=None, Returns ------- - axes : collection of Matplotlib Axes + collection of Matplotlib Axes """ _raise_if_no_mpl() _converter._WARN = False @@ -2751,7 +2751,7 @@ def line(self, **kwds): Returns ------- - axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them + :class:`matplotlib.axes.Axes` or numpy.ndarray of them Examples -------- @@ -2776,7 +2776,7 @@ def bar(self, **kwds): Returns ------- - axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them + :class:`matplotlib.axes.Axes` or numpy.ndarray of them """ return self(kind='bar', **kwds) @@ -2792,7 +2792,7 @@ def barh(self, **kwds): Returns ------- - axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them + :class:`matplotlib.axes.Axes` or numpy.ndarray of them """ return self(kind='barh', **kwds) @@ -2808,7 +2808,7 @@ def box(self, **kwds): Returns ------- - axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them + :class:`matplotlib.axes.Axes` or numpy.ndarray of them """ return self(kind='box', **kwds) @@ -2826,7 +2826,7 @@ def hist(self, bins=10, **kwds): Returns ------- - axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them + :class:`matplotlib.axes.Axes` or numpy.ndarray of them """ return self(kind='hist', bins=bins, **kwds) @@ -2885,7 +2885,7 @@ def area(self, **kwds): Returns ------- - axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them. + :class:`matplotlib.axes.Axes` or numpy.ndarray of them """ return self(kind='area', **kwds) @@ -2901,7 +2901,7 @@ def pie(self, **kwds): Returns ------- - axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them. + :class:`matplotlib.axes.Axes` or numpy.ndarray of them """ return self(kind='pie', **kwds) @@ -2961,8 +2961,8 @@ def line(self, x=None, y=None, **kwds): Returns ------- - axes : :class:`matplotlib.axes.Axes` or :class:`numpy.ndarray` - Returns an ndarray when ``subplots=True``. + :class:`matplotlib.axes.Axes` or :class:`numpy.ndarray` + Return an ndarray when ``subplots=True``. See Also -------- @@ -3026,7 +3026,7 @@ def bar(self, x=None, y=None, **kwds): Returns ------- - axes : matplotlib.axes.Axes or np.ndarray of them + matplotlib.axes.Axes or np.ndarray of them An ndarray is returned with one :class:`matplotlib.axes.Axes` per column when ``subplots=True``. @@ -3108,7 +3108,7 @@ def barh(self, x=None, y=None, **kwds): Returns ------- - axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them. + :class:`matplotlib.axes.Axes` or numpy.ndarray of them See Also -------- @@ -3195,7 +3195,7 @@ def box(self, by=None, **kwds): Returns ------- - axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them + :class:`matplotlib.axes.Axes` or numpy.ndarray of them See Also -------- @@ -3238,7 +3238,7 @@ def hist(self, by=None, bins=10, **kwds): Returns ------- - axes : matplotlib.AxesSubplot histogram. + matplotlib.AxesSubplot histogram. See Also -------- @@ -3402,7 +3402,7 @@ def pie(self, y=None, **kwds): Returns ------- - axes : matplotlib.axes.Axes or np.ndarray of them. + matplotlib.axes.Axes or np.ndarray of them A NumPy array is returned when `subplots` is True. See Also @@ -3478,7 +3478,7 @@ def scatter(self, x, y, s=None, c=None, **kwds): Returns ------- - axes : :class:`matplotlib.axes.Axes` or numpy.ndarray of them + :class:`matplotlib.axes.Axes` or numpy.ndarray of them See Also -------- diff --git a/pandas/plotting/_misc.py b/pandas/plotting/_misc.py index 1e0d44ffcf0d4..39a27f3746479 100644 --- a/pandas/plotting/_misc.py +++ b/pandas/plotting/_misc.py @@ -178,7 +178,7 @@ def radviz(frame, class_column, ax=None, color=None, colormap=None, **kwds): Returns ------- - axes : :class:`matplotlib.axes.Axes` + class:`matplotlib.axes.Axes` See Also -------- @@ -302,7 +302,7 @@ def andrews_curves(frame, class_column, ax=None, samples=200, color=None, Returns ------- - ax : Matplotlib axis object + Matplotlib axis object """ from math import sqrt, pi @@ -389,7 +389,7 @@ def bootstrap_plot(series, fig=None, size=50, samples=500, **kwds): Returns ------- - fig : matplotlib.figure.Figure + matplotlib.figure.Figure Matplotlib figure. See Also @@ -490,7 +490,7 @@ def parallel_coordinates(frame, class_column, cols=None, ax=None, color=None, Returns ------- - ax: matplotlib axis object + matplotlib axis object Examples -------- @@ -579,7 +579,7 @@ def lag_plot(series, lag=1, ax=None, **kwds): Returns ------- - ax: Matplotlib axis object + Matplotlib axis object """ import matplotlib.pyplot as plt @@ -610,7 +610,7 @@ def autocorrelation_plot(series, ax=None, **kwds): Returns: ----------- - ax: Matplotlib axis object + Matplotlib axis object """ import matplotlib.pyplot as plt n = len(series) diff --git a/pandas/tseries/frequencies.py b/pandas/tseries/frequencies.py index ff35f6c7a98e1..b933707df8c36 100644 --- a/pandas/tseries/frequencies.py +++ b/pandas/tseries/frequencies.py @@ -67,7 +67,7 @@ def to_offset(freq): Returns ------- - delta : DateOffset + DateOffset None if freq is None. Raises @@ -214,7 +214,7 @@ def infer_freq(index, warn=True): Returns ------- - freq : string or None + str or None None if no discernible frequency TypeError if the index is not datetime-like ValueError if there are less than three values. @@ -300,7 +300,7 @@ def get_freq(self): Returns ------- - freqstr : str or None + str or None """ if not self.is_monotonic or not self.index._is_unique: return None From 7601aed516fe69bdb81debe584713b88bb151a9a Mon Sep 17 00:00:00 2001 From: thoo Date: Tue, 5 Feb 2019 20:07:38 -0500 Subject: [PATCH 08/24] fix upon suggestions --- pandas/core/arrays/categorical.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 31c6f1baa3cd5..0a08ef51e169c 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -1292,7 +1292,7 @@ def __array__(self, dtype=None): values : numpy array A numpy array of either the specified dtype or, if dtype==None (default), the same dtype as - categorical.categories.dtype . + categorical.categories.dtype """ ret = take_1d(self.categories.values, self._codes) if dtype and not is_dtype_equal(dtype, self.categories.dtype): From 128dadb621264e6a0ca169890e8ac04a78d3ac10 Mon Sep 17 00:00:00 2001 From: thoo Date: Tue, 5 Feb 2019 21:10:47 -0500 Subject: [PATCH 09/24] fix failing tests --- pandas/core/arrays/categorical.py | 2 +- pandas/plotting/_core.py | 45 ++++++++++++++++--------------- 2 files changed, 24 insertions(+), 23 deletions(-) diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 0a08ef51e169c..a371f157f156b 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -1292,7 +1292,7 @@ def __array__(self, dtype=None): values : numpy array A numpy array of either the specified dtype or, if dtype==None (default), the same dtype as - categorical.categories.dtype + categorical.categories.dtype. """ ret = take_1d(self.categories.values, self._codes) if dtype and not is_dtype_equal(dtype, self.categories.dtype): diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index 23f87c28102aa..c762b11c3f8e0 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -1809,26 +1809,26 @@ def _plot(data, x=None, y=None, subplots=False, Allows plotting of one column versus another""" series_coord = "" -df_unique = """stacked : boolean, default False in line and +df_unique = """stacked : bool, default False in line and bar plots, and True in area plot. If True, create stacked plot. - sort_columns : boolean, default False + sort_columns : bool, default False Sort column names to determine plot ordering - secondary_y : boolean or sequence, default False + secondary_y : bool or sequence, default False Whether to plot on the secondary y-axis If a list/tuple, which columns to plot on secondary y-axis""" series_unique = """label : label argument to provide to plot - secondary_y : boolean or sequence of ints, default False + secondary_y : bool or sequence of ints, default False If True then y-axis will be on the right""" df_ax = """ax : matplotlib axes object, default None - subplots : boolean, default False + subplots : bool, default False Make separate subplots for each column - sharex : boolean, default True if ax is None else False + sharex : bool, default True if ax is None else False In case subplots=True, share x axis and set some x axis labels to invisible; defaults to True if ax is None otherwise False if an ax is passed in; Be aware, that passing in both an ax and sharex=True will alter all x axis labels for all axis in a figure! - sharey : boolean, default False + sharey : bool, default False In case subplots=True, share y axis and set some y axis labels to invisible layout : tuple (optional) @@ -1882,23 +1882,23 @@ def _plot(data, x=None, y=None, subplots=False, %(klass_kind)s %(klass_ax)s figsize : a tuple (width, height) in inches - use_index : boolean, default True + use_index : bool, default True Use index as ticks for x axis title : string or list Title to use for the plot. If a string is passed, print the string at the top of the figure. If a list is passed and `subplots` is True, print each item in the list above the corresponding subplot. - grid : boolean, default None (matlab style default) + grid : bool, default None (matlab style default) Axis grid lines legend : False/True/'reverse' Place legend on axis subplots style : list or dict matplotlib line style per column - logx : boolean, default False + logx : bool, default False Use log scaling on x axis - logy : boolean, default False + logy : bool, default False Use log scaling on y axis - loglog : boolean, default False + loglog : bool, default False Use log scaling on both x and y axes xticks : sequence Values to use for the xticks @@ -1913,12 +1913,12 @@ def _plot(data, x=None, y=None, subplots=False, colormap : str or matplotlib colormap object, default None Colormap to select colors from. If string, load colormap with that name from matplotlib. - colorbar : boolean, optional + colorbar : bool, optional If True, plot colorbar (only relevant for 'scatter' and 'hexbin' plots) position : float Specify relative alignments for bar plot layout. From 0 (left/bottom-end) to 1 (right/top-end). Default is 0.5 (center) - table : boolean, Series or DataFrame, default False + table : bool, Series or DataFrame, default False If True, draw a table using the data in the DataFrame and the data will be transposed to meet matplotlib's default layout. If a Series or DataFrame is passed, use passed data to draw a table. @@ -1927,7 +1927,7 @@ def _plot(data, x=None, y=None, subplots=False, detail. xerr : same types as yerr. %(klass_unique)s - mark_right : boolean, default True + mark_right : bool, default True When using a secondary_y axis, automatically mark the column labels with "(right)" in the legend `**kwds` : keywords @@ -2025,7 +2025,7 @@ def plot_series(data, kind='line', ax=None, # Series unique rot : int or float, default 0 The rotation angle of labels (in degrees) with respect to the screen coordinate system. - grid : boolean, default True + grid : bool, default True Setting this to True will show the grid. figsize : A tuple (width, height) in inches The size of the figure to create in matplotlib. @@ -2062,6 +2062,7 @@ def plot_series(data, kind='line', ax=None, # Series unique * :class:`~pandas.Series` * :class:`~numpy.array` (for ``return_type = None``) + Return N-dimentional array. See Also -------- @@ -2320,7 +2321,7 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None, If passed, will be used to limit data to a subset of columns. by : object, optional If passed, then used to form histograms for separate groups. - grid : boolean, default True + grid : bool, default True Whether to show axis grid lines. xlabelsize : int, default None If specified changes the x-axis label size. @@ -2334,13 +2335,13 @@ def hist_frame(data, column=None, by=None, grid=True, xlabelsize=None, y labels rotated 90 degrees clockwise. ax : Matplotlib axes object, default None The axes to plot the histogram on. - sharex : boolean, default True if ax is None else False + sharex : bool, default True if ax is None else False In case subplots=True, share x axis and set some x axis labels to invisible; defaults to True if ax is None otherwise False if an ax is passed in. Note that passing in both an ax and sharex=True will alter all x axis labels for all subplots in a figure. - sharey : boolean, default False + sharey : bool, default False In case subplots=True, share y axis and set some y axis labels to invisible. figsize : tuple @@ -2427,7 +2428,7 @@ def hist_series(self, by=None, ax=None, grid=True, xlabelsize=None, If passed, then used to form histograms for separate groups ax : matplotlib axis object If not passed, uses gca() - grid : boolean, default True + grid : bool, default True Whether to show axis grid lines xlabelsize : int, default None If specified changes the x-axis label size @@ -2509,8 +2510,8 @@ def grouped_hist(data, column=None, by=None, ax=None, bins=50, figsize=None, bins : int, default 50 figsize : tuple, optional layout : optional - sharex : boolean, default False - sharey : boolean, default False + sharex : bool, default False + sharey : bool, default False rot : int, default 90 grid : bool, default True kwargs : dict, keyword arguments passed to matplotlib.Axes.hist From 3d3e408221a474309d0021892ccc23c08a6a783b Mon Sep 17 00:00:00 2001 From: thoo Date: Tue, 5 Feb 2019 22:48:21 -0500 Subject: [PATCH 10/24] replace with bullet --- pandas/core/algorithms.py | 9 ++++-- pandas/core/frame.py | 60 +++++++++++++++++++-------------------- pandas/core/generic.py | 26 ++++++++++------- pandas/plotting/_core.py | 4 +-- 4 files changed, 54 insertions(+), 45 deletions(-) diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index 95cfe92dcf060..335a9b67bc549 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -289,9 +289,12 @@ def unique(values): Returns ------- unique values - If the input is an Index, the return is an Index.\n - If the input is a Categorical dtype, the return is a Categorical.\n - If the input is a Series/ndarray, the return will be an ndarray. + + The return can be: + + - If the input is an Index, the return is an Index. + - If the input is a Categorical dtype, the return is a Categorical. + - If the input is a Series/ndarray, the return will be an ndarray. See Also -------- diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 10baa739f144b..2d6057d855052 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -1161,7 +1161,7 @@ def to_numpy(self, dtype=None, copy=False): Returns ------- - array : numpy.ndarray + numpy.ndarray See Also -------- @@ -1455,7 +1455,7 @@ def from_records(cls, data, index=None, exclude=None, columns=None, Returns ------- - df : DataFrame + DataFrame """ # Make a copy of the input columns so we can modify it @@ -1771,7 +1771,7 @@ def from_items(cls, items, columns=None, orient='columns'): Returns ------- - frame : DataFrame + DataFrame """ warnings.warn("from_items is deprecated. Please use " @@ -1882,7 +1882,7 @@ def from_csv(cls, path, header=0, sep=',', index_col=0, parse_dates=True, Returns ------- - y : DataFrame + DataFrame See Also -------- @@ -1972,7 +1972,7 @@ def to_panel(self): Returns ------- - panel : Panel + Panel """ # only support this kind for now if (not isinstance(self.index, MultiIndex) or # pragma: no cover @@ -2532,7 +2532,7 @@ def memory_usage(self, index=True, deep=False): Returns ------- - sizes : Series + Series A Series whose index is the original column names and whose values is the memory usage of each column in bytes. @@ -2750,7 +2750,7 @@ def get_value(self, index, col, takeable=False): Returns ------- - value : scalar value + scalar value """ warnings.warn("get_value is deprecated and will be removed " @@ -2795,7 +2795,7 @@ def set_value(self, index, col, value, takeable=False): Returns ------- - frame : DataFrame + DataFrame If label pair is contained, will be reference to calling DataFrame, otherwise a new object. """ @@ -3231,7 +3231,7 @@ def select_dtypes(self, include=None, exclude=None): Returns ------- - subset : DataFrame + DataFrame The subset of the frame including the dtypes in ``include`` and excluding the dtypes in ``exclude``. @@ -3596,7 +3596,7 @@ def _sanitize_column(self, key, value, broadcast=True): Returns ------- - sanitized_column : numpy-array + numpy-array """ def reindexer(value): @@ -3865,7 +3865,7 @@ def drop(self, labels=None, axis=0, index=None, columns=None, Returns ------- - dropped : pandas.DataFrame + pandas.DataFrame Raises ------ @@ -3990,7 +3990,7 @@ def rename(self, *args, **kwargs): Returns ------- - renamed : DataFrame + DataFrame See Also -------- @@ -4639,7 +4639,7 @@ def drop_duplicates(self, subset=None, keep='first', inplace=False): Returns ------- - deduplicated : DataFrame + DataFrame """ if self.empty: return self.copy() @@ -4673,7 +4673,7 @@ def duplicated(self, subset=None, keep='first'): Returns ------- - duplicated : Series + Series """ from pandas.core.sorting import get_group_index from pandas._libs.hashtable import duplicated_int64, _SIZE_HINT_LIMIT @@ -5041,7 +5041,7 @@ def swaplevel(self, i=-2, j=-1, axis=0): Returns ------- - swapped : same type as caller (new object) + same type as caller (new object) .. versionchanged:: 0.18.1 @@ -5320,7 +5320,7 @@ def combine_first(self, other): Returns ------- - combined : DataFrame + DataFrame See Also -------- @@ -5681,7 +5681,7 @@ def pivot(self, index=None, columns=None, values=None): Returns ------- - table : DataFrame + DataFrame See Also -------- @@ -5967,7 +5967,7 @@ def unstack(self, level=-1, fill_value=None): Returns ------- - unstacked : DataFrame or Series + DataFrame or Series See Also -------- @@ -6133,7 +6133,7 @@ def diff(self, periods=1, axis=0): Returns ------- - diffed : DataFrame + DataFrame See Also -------- @@ -6405,7 +6405,7 @@ def apply(self, func, axis=0, broadcast=None, raw=False, reduce=None, Returns ------- - applied : Series or DataFrame + Series or DataFrame See Also -------- @@ -6598,7 +6598,7 @@ def append(self, other, ignore_index=False, Returns ------- - appended : DataFrame + DataFrame See Also -------- @@ -6908,7 +6908,7 @@ def round(self, decimals=0, *args, **kwargs): Returns ------- - DataFrame : + DataFrame A DataFrame with the affected columns rounded to the specified number of decimal places. @@ -7021,7 +7021,7 @@ def corr(self, method='pearson', min_periods=1): Returns ------- - y : DataFrame + DataFrame See Also -------- @@ -7215,7 +7215,7 @@ def corrwith(self, other, axis=0, drop=False, method='pearson'): Returns ------- - correls : Series + Series See Also ------- @@ -7545,7 +7545,7 @@ def nunique(self, axis=0, dropna=True): Returns ------- - nunique : Series + Series See Also -------- @@ -7583,7 +7583,7 @@ def idxmin(self, axis=0, skipna=True): Returns ------- - idxmin : Series + Series Raises ------ @@ -7619,7 +7619,7 @@ def idxmax(self, axis=0, skipna=True): Returns ------- - idxmax : Series + Series Raises ------ @@ -7766,7 +7766,7 @@ def quantile(self, q=0.5, axis=0, numeric_only=True, Returns ------- - quantiles : Series or DataFrame + Series or DataFrame If ``q`` is an array, a DataFrame will be returned where the index is ``q``, the columns are the columns of self, and the @@ -7848,7 +7848,7 @@ def to_timestamp(self, freq=None, how='start', axis=0, copy=True): Returns ------- - df : DataFrame with DatetimeIndex + DataFrame with DatetimeIndex """ new_data = self._data if copy: @@ -7880,7 +7880,7 @@ def to_period(self, freq=None, axis=0, copy=True): Returns ------- - ts : TimeSeries with PeriodIndex + TimeSeries with PeriodIndex """ new_data = self._data if copy: diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 595c7c1266fc6..18d177a957fd0 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -4951,11 +4951,14 @@ def pipe(self, func, *args, **kwargs): Returns ------- DataFrame, Series or scalar - If DataFrame.agg is called with a single function, returns a Series.\n - If DataFrame.agg is called with several functions, returns - a DataFrame.\n - If Series.agg is called with single function, returns a scalar.\n - If Series.agg is called with several functions, returns a Series. + + The return can be: + + - If DataFrame.agg is called with a single function, returns a Series. + - If DataFrame.agg is called with several functions, returns + a DataFrame. + - If Series.agg is called with single function, returns a scalar. + - If Series.agg is called with several functions, returns a Series. %(see_also)s @@ -6879,11 +6882,14 @@ def asof(self, where, subset=None): ------- scalar, Series, or DataFrame - Scalar : when `self` is a Series and `where` is a scalar - Series: when `self` is a Series and `where` is an array-like, - or when `self` is a DataFrame and `where` is a scalar - DataFrame : when `self` is a DataFrame and `where` is an - array-like. + The return can be: + + * Scalar : when `self` is a Series and `where` is a scalar + * Series: when `self` is a Series and `where` is an array-like, + or when `self` is a DataFrame and `where` is a scalar + * DataFrame : when `self` is a DataFrame and `where` is an + array-like + Return scala, Sereis, or DataFrame. See Also -------- diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index c762b11c3f8e0..701fe3331e379 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -2060,9 +2060,9 @@ def plot_series(data, kind='line', ax=None, # Series unique For data grouped with ``by``: - * :class:`~pandas.Series` + * :class:`~pandas.Series` \n * :class:`~numpy.array` (for ``return_type = None``) - Return N-dimentional array. + Return Series or numpy.array. See Also -------- From 522e76d6c27232678cdd0fbcca97b7e285502d20 Mon Sep 17 00:00:00 2001 From: thoo Date: Tue, 5 Feb 2019 22:49:01 -0500 Subject: [PATCH 11/24] typo --- pandas/plotting/_core.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index 701fe3331e379..f6af3182bb79d 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -2060,7 +2060,7 @@ def plot_series(data, kind='line', ax=None, # Series unique For data grouped with ``by``: - * :class:`~pandas.Series` \n + * :class:`~pandas.Series` * :class:`~numpy.array` (for ``return_type = None``) Return Series or numpy.array. From 163e9e39c355087caa3886acb7f8a8a857cb7f0d Mon Sep 17 00:00:00 2001 From: thoo Date: Wed, 6 Feb 2019 00:05:22 -0500 Subject: [PATCH 12/24] Retrigger :pandas-dev conda 27 failed From 25e7503c6330c1913cd578bf4dfb7040fb45d097 Mon Sep 17 00:00:00 2001 From: thoo Date: Fri, 8 Feb 2019 15:08:15 -0500 Subject: [PATCH 13/24] update code_checks.sh --- ci/code_checks.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index e845018d46968..99310d210038b 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -241,16 +241,8 @@ fi ### DOCSTRINGS ### if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then -<<<<<<< HEAD MSG='Validate docstrings (GL06, GL07, GL09, SS04, SS05, PR03, PR05, EX04, RT04, RT05, SA05)' ; echo $MSG $BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,SS05,PR03,PR05,EX04,RT04,RT05,SA05 -||||||| merged common ancestors - MSG='Validate docstrings (GL06, GL07, GL09, SS04, PR03, PR05, EX04, RT04, SS05, SA05)' ; echo $MSG - $BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR05,EX04,RT04,SS05,SA05 -======= - MSG='Validate docstrings (GL06, GL07, GL09, SS04, PR03, PR05, PR10, EX04, RT04, SS05, SA05)' ; echo $MSG - $BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR05,EX04,RT04,SS05,SA05 ->>>>>>> upstream/master RET=$(($RET + $?)) ; echo $MSG "DONE" fi From e12ee2a2e6e77ee23baca2973a1264c18a74d01e Mon Sep 17 00:00:00 2001 From: thoo Date: Sat, 16 Feb 2019 16:18:09 -0500 Subject: [PATCH 14/24] fix as recommended --- pandas/core/algorithms.py | 2 +- pandas/core/arrays/categorical.py | 12 +++---- pandas/core/frame.py | 52 ++----------------------------- pandas/plotting/_misc.py | 8 ++--- 4 files changed, 13 insertions(+), 61 deletions(-) diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index 2fa1b5e431626..13eeab1d3bdff 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -288,7 +288,7 @@ def unique(values): Returns ------- - unique values + numpy.ndarray or ExtensionArray The return can be: diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 7ae52e06dc5b8..37a24a54be8b1 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -1289,7 +1289,7 @@ def __array__(self, dtype=None): Returns ------- - values : numpy array + numpy.array A numpy array of either the specified dtype or, if dtype==None (default), the same dtype as categorical.categories.dtype. @@ -1499,7 +1499,7 @@ def get_values(self): Returns ------- - values : numpy array + numpy.array A numpy array of the same dtype as categorical.categories.dtype or Index if datetime / periods. """ @@ -1540,7 +1540,7 @@ def argsort(self, *args, **kwargs): Returns ------- - argsorted : numpy array + numpy.array See Also -------- @@ -1593,7 +1593,7 @@ def sort_values(self, inplace=False, ascending=True, na_position='last'): Returns ------- - y : Categorical or None + Categorical or None See Also -------- @@ -1667,7 +1667,7 @@ def _values_for_rank(self): Returns ------- - numpy array + numpy.array """ from pandas import Series @@ -1695,7 +1695,7 @@ def ravel(self, order='C'): Returns ------- - raveled : numpy array + numpy.array """ return np.array(self) diff --git a/pandas/core/frame.py b/pandas/core/frame.py index d5f5174b739d7..8b043ea711a8b 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -2696,7 +2696,7 @@ def get_value(self, index, col, takeable=False): Returns ------- - scalar value + scalar """ warnings.warn("get_value is deprecated and will be removed " @@ -2736,7 +2736,7 @@ def set_value(self, index, col, value, takeable=False): ---------- index : row label col : column label - value : scalar value + value : scalar takeable : interpret the index/col as indexers, default False Returns @@ -3542,13 +3542,7 @@ def _sanitize_column(self, key, value, broadcast=True): Returns ------- -<<<<<<< HEAD - numpy-array -||||||| merged common ancestors - sanitized_column : numpy-array -======= numpy.ndarray ->>>>>>> upstream/master """ def reindexer(value): @@ -3817,13 +3811,7 @@ def drop(self, labels=None, axis=0, index=None, columns=None, Returns ------- -<<<<<<< HEAD - pandas.DataFrame -||||||| merged common ancestors - dropped : pandas.DataFrame -======= DataFrame ->>>>>>> upstream/master Raises ------ @@ -5919,13 +5907,7 @@ def unstack(self, level=-1, fill_value=None): Returns ------- -<<<<<<< HEAD - DataFrame or Series -||||||| merged common ancestors - unstacked : DataFrame or Series -======= Series or DataFrame ->>>>>>> upstream/master See Also -------- @@ -6363,15 +6345,9 @@ def apply(self, func, axis=0, broadcast=None, raw=False, reduce=None, Returns ------- -<<<<<<< HEAD - Series or DataFrame -||||||| merged common ancestors - applied : Series or DataFrame -======= Series or DataFrame Result of applying ``func`` along the given axis of the DataFrame. ->>>>>>> upstream/master See Also -------- @@ -6987,14 +6963,8 @@ def corr(self, method='pearson', min_periods=1): Returns ------- -<<<<<<< HEAD - DataFrame -||||||| merged common ancestors - y : DataFrame -======= DataFrame Correlation matrix. ->>>>>>> upstream/master See Also -------- @@ -7190,14 +7160,8 @@ def corrwith(self, other, axis=0, drop=False, method='pearson'): Returns ------- -<<<<<<< HEAD - Series -||||||| merged common ancestors - correls : Series -======= Series Pairwise correlations. ->>>>>>> upstream/master See Also ------- @@ -7565,14 +7529,8 @@ def idxmin(self, axis=0, skipna=True): Returns ------- -<<<<<<< HEAD - Series -||||||| merged common ancestors - idxmin : Series -======= Series Indexes of minima along the specified axis. ->>>>>>> upstream/master Raises ------ @@ -7608,14 +7566,8 @@ def idxmax(self, axis=0, skipna=True): Returns ------- -<<<<<<< HEAD - Series -||||||| merged common ancestors - idxmax : Series -======= Series Indexes of maxima along the specified axis. ->>>>>>> upstream/master Raises ------ diff --git a/pandas/plotting/_misc.py b/pandas/plotting/_misc.py index 4170d4206e772..5171ea68fd497 100644 --- a/pandas/plotting/_misc.py +++ b/pandas/plotting/_misc.py @@ -302,7 +302,7 @@ def andrews_curves(frame, class_column, ax=None, samples=200, color=None, Returns ------- - Matplotlib axis object + class:`matplotlip.axis.Axes` """ from math import sqrt, pi @@ -490,7 +490,7 @@ def parallel_coordinates(frame, class_column, cols=None, ax=None, color=None, Returns ------- - matplotlib axis object + class:`matplotlib.axis.Axes` Examples -------- @@ -579,7 +579,7 @@ def lag_plot(series, lag=1, ax=None, **kwds): Returns ------- - Matplotlib axis object + class:`matplotlib.axis.Axes` """ import matplotlib.pyplot as plt @@ -610,7 +610,7 @@ def autocorrelation_plot(series, ax=None, **kwds): Returns: ----------- - Matplotlib axis object + class:`matplotlib.axis.Axes` """ import matplotlib.pyplot as plt n = len(series) From bfe30f8b2e174d0399c43800ded85bc0af44c455 Mon Sep 17 00:00:00 2001 From: thoo Date: Sat, 16 Feb 2019 18:47:59 -0500 Subject: [PATCH 15/24] fix some leftover --- pandas/core/indexes/base.py | 8 ++++---- pandas/plotting/_core.py | 3 ++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 90e66bf254d91..949a99220bf2c 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -1441,7 +1441,7 @@ def sortlevel(self, level=None, ascending=True, sort_remaining=None): Returns ------- - sorted_index : Index + Index """ return self.sort_values(return_indexer=True, ascending=ascending) @@ -1459,7 +1459,7 @@ def _get_level_values(self, level): Returns ------- - values : Index + Index Calling object, as there is only one level in the Index. See Also @@ -1504,7 +1504,7 @@ def droplevel(self, level=0): Returns ------- - index : Index or MultiIndex + Index or MultiIndex """ if not isinstance(level, (tuple, list)): level = [level] @@ -2970,7 +2970,7 @@ def _convert_listlike_indexer(self, keyarr, kind=None): Returns ------- - tuple (indexer, keyarr) + indexer, keyarr indexer is an ndarray or None if cannot convert keyarr are tuple-safe keys. """ diff --git a/pandas/plotting/_core.py b/pandas/plotting/_core.py index 98d5370e7b070..48d870bfc2e03 100644 --- a/pandas/plotting/_core.py +++ b/pandas/plotting/_core.py @@ -3240,7 +3240,8 @@ def hist(self, by=None, bins=10, **kwds): Returns ------- - matplotlib.AxesSubplot histogram. + class:`matplotlib.AxesSubplot` + Return a histogram plot. See Also -------- From d5d270baa69e20184fc02dcb5bd2551bbe8d31a6 Mon Sep 17 00:00:00 2001 From: thoo Date: Sat, 16 Feb 2019 21:06:34 -0500 Subject: [PATCH 16/24] Retrigger :pandas-devs failed From 6ac909bdd7c423993766223796d84e5adcb75b73 Mon Sep 17 00:00:00 2001 From: thoo Date: Sun, 17 Feb 2019 11:31:22 -0500 Subject: [PATCH 17/24] Retrigger :pandas-devs failed second time From 4e4f24a9b1dee94181030e65acda00282b4889f7 Mon Sep 17 00:00:00 2001 From: thoo Date: Sun, 17 Feb 2019 13:00:02 -0500 Subject: [PATCH 18/24] Retrigger :pandas-devs failed second time From 953159c5e702c274c0205e8d36796577eaa1207d Mon Sep 17 00:00:00 2001 From: thoo Date: Wed, 20 Feb 2019 14:21:32 -0500 Subject: [PATCH 19/24] fix at Series.unique --- pandas/core/series.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pandas/core/series.py b/pandas/core/series.py index 68c7aa0744e7f..ea35ef3716d25 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -1667,7 +1667,8 @@ def unique(self): * Datetime with Timezone * Interval * Sparse - * IntegerNA . + * IntegerNA + See Examples section. Examples -------- From 94e5279d8af3481a8327e17faae6a890295fa132 Mon Sep 17 00:00:00 2001 From: thoo Date: Wed, 20 Feb 2019 20:30:41 -0500 Subject: [PATCH 20/24] add PR10 --- ci/code_checks.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 39b30240573bf..c4840f1e836c4 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -241,8 +241,8 @@ fi ### DOCSTRINGS ### if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then - MSG='Validate docstrings (GL06, GL07, GL09, SS04, SS05, PR03, PR04, PR05, EX04, RT04, RT05, SA05)' ; echo $MSG - $BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,SS05,PR03,PR04,PR05,EX04,RT04,RT05,SA05 + MSG='Validate docstrings (GL06, GL07, GL09, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT04, RT05, SA05)' ; echo $MSG + $BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT04,RT05,SA05 RET=$(($RET + $?)) ; echo $MSG "DONE" fi From 39ab01059efcb009395b3603eacbe531bbbb55db Mon Sep 17 00:00:00 2001 From: thoo Date: Wed, 20 Feb 2019 21:36:24 -0500 Subject: [PATCH 21/24] drop PR10 --- ci/code_checks.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index c4840f1e836c4..39b30240573bf 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -241,8 +241,8 @@ fi ### DOCSTRINGS ### if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then - MSG='Validate docstrings (GL06, GL07, GL09, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT04, RT05, SA05)' ; echo $MSG - $BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT04,RT05,SA05 + MSG='Validate docstrings (GL06, GL07, GL09, SS04, SS05, PR03, PR04, PR05, EX04, RT04, RT05, SA05)' ; echo $MSG + $BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,SS05,PR03,PR04,PR05,EX04,RT04,RT05,SA05 RET=$(($RET + $?)) ; echo $MSG "DONE" fi From 64bd51b5ef0839c8e71e0e99d52ec220ff6ecba8 Mon Sep 17 00:00:00 2001 From: thoo Date: Wed, 20 Feb 2019 21:58:27 -0500 Subject: [PATCH 22/24] fix PR10 error --- ci/code_checks.sh | 4 ++-- pandas/io/excel/_base.py | 4 +--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/ci/code_checks.sh b/ci/code_checks.sh index 39b30240573bf..c4840f1e836c4 100755 --- a/ci/code_checks.sh +++ b/ci/code_checks.sh @@ -241,8 +241,8 @@ fi ### DOCSTRINGS ### if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then - MSG='Validate docstrings (GL06, GL07, GL09, SS04, SS05, PR03, PR04, PR05, EX04, RT04, RT05, SA05)' ; echo $MSG - $BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,SS05,PR03,PR04,PR05,EX04,RT04,RT05,SA05 + MSG='Validate docstrings (GL06, GL07, GL09, SS04, SS05, PR03, PR04, PR05, PR10, EX04, RT04, RT05, SA05)' ; echo $MSG + $BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,SS05,PR03,PR04,PR05,PR10,EX04,RT04,RT05,SA05 RET=$(($RET + $?)) ; echo $MSG "DONE" fi diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index 8f7bf8e0466f9..406569aad54ae 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -508,9 +508,7 @@ class ExcelWriter(object): Format string for datetime objects written into Excel files (e.g. 'YYYY-MM-DD HH:MM:SS') mode : {'w' or 'a'}, default 'w' - File mode to use (write or append). - - .. versionadded:: 0.24.0 + File mode to use (write or append). .. versionadded:: 0.24.0 Attributes ---------- From 7051e3c3e0c26b31078c1775bfef27c12d89d588 Mon Sep 17 00:00:00 2001 From: thoo Date: Thu, 21 Feb 2019 23:38:19 -0500 Subject: [PATCH 23/24] fix as recommended --- pandas/core/algorithms.py | 8 +++++--- pandas/core/frame.py | 1 + pandas/core/generic.py | 21 +++++++++++++-------- pandas/core/indexes/base.py | 7 +++++-- pandas/core/series.py | 1 + pandas/io/excel/_base.py | 4 +++- 6 files changed, 28 insertions(+), 14 deletions(-) diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index 13eeab1d3bdff..f78ec5f936cbf 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -292,9 +292,11 @@ def unique(values): The return can be: - - If the input is an Index, the return is an Index. - - If the input is a Categorical dtype, the return is a Categorical. - - If the input is a Series/ndarray, the return will be an ndarray. + * Index : when the input is an Index + * Categorical : when the input is a Categorical dtype + * ndarray : when the input is a Series/ndarray + + Return numpy.ndarray or ExtensionArray See Also -------- diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 7a0cf746f3e5b..afd8a1586689a 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -6955,6 +6955,7 @@ def corr(self, method='pearson', min_periods=1): * spearman : Spearman rank correlation * callable: callable with input two 1d ndarrays and returning a float + .. versionadded:: 0.24.0 min_periods : int, optional diff --git a/pandas/core/generic.py b/pandas/core/generic.py index d23d562d1ee3b..07ccf5979e5be 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -2807,14 +2807,17 @@ def to_latex(self, buf=None, columns=None, col_space=None, header=True, defaults to 'ascii' on Python 2 and 'utf-8' on Python 3. decimal : str, default '.' Character recognized as decimal separator, e.g. ',' in Europe. + .. versionadded:: 0.18.0 multicolumn : bool, default True Use \multicolumn to enhance MultiIndex columns. The default will be read from the config module. + .. versionadded:: 0.20.0 multicolumn_format : str, default 'l' The alignment for multicolumns, similar to `column_format` The default will be read from the config module. + .. versionadded:: 0.20.0 multirow : bool, default False Use \multirow to enhance MultiIndex rows. Requires adding a @@ -2822,6 +2825,7 @@ def to_latex(self, buf=None, columns=None, col_space=None, header=True, centered labels (instead of top-aligned) across the contained rows, separating groups via clines. The default will be read from the pandas config module. + .. versionadded:: 0.20.0 Returns @@ -4948,15 +4952,15 @@ def pipe(self, func, *args, **kwargs): Returns ------- - DataFrame, Series or scalar + scalar, Series or DataFrame The return can be: - - If DataFrame.agg is called with a single function, returns a Series. - - If DataFrame.agg is called with several functions, returns - a DataFrame. - - If Series.agg is called with single function, returns a scalar. - - If Series.agg is called with several functions, returns a Series. + * scalar : when Series.agg is called with single function + * Series : when DataFrame.agg is called with a single function + * DataFrame : when DataFrame.agg is called with several functions + + Return scalar, Series or DataFrame. %(see_also)s @@ -6885,12 +6889,13 @@ def asof(self, where, subset=None): The return can be: - * Scalar : when `self` is a Series and `where` is a scalar + * scalar : when `self` is a Series and `where` is a scalar * Series: when `self` is a Series and `where` is an array-like, or when `self` is a DataFrame and `where` is a scalar * DataFrame : when `self` is a DataFrame and `where` is an array-like - Return scalar, Sereis, or DataFrame. + + Return scalar, Series, or DataFrame. See Also -------- diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index a4914e413011e..b0f6c8e3230e5 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -2972,8 +2972,11 @@ def _convert_listlike_indexer(self, keyarr, kind=None): Returns ------- indexer, keyarr - indexer is an ndarray or None if cannot convert - keyarr are tuple-safe keys. + The return can be: + - indexer : an ndarray or None if cannot convert + - keyarr : tuple-safe keys + + Return indexer, keyarr. """ if isinstance(keyarr, Index): keyarr = self._convert_index_indexer(keyarr) diff --git a/pandas/core/series.py b/pandas/core/series.py index ea35ef3716d25..15c4c736aafb4 100644 --- a/pandas/core/series.py +++ b/pandas/core/series.py @@ -1668,6 +1668,7 @@ def unique(self): * Interval * Sparse * IntegerNA + See Examples section. Examples diff --git a/pandas/io/excel/_base.py b/pandas/io/excel/_base.py index 406569aad54ae..c6d390692c789 100644 --- a/pandas/io/excel/_base.py +++ b/pandas/io/excel/_base.py @@ -508,7 +508,9 @@ class ExcelWriter(object): Format string for datetime objects written into Excel files (e.g. 'YYYY-MM-DD HH:MM:SS') mode : {'w' or 'a'}, default 'w' - File mode to use (write or append). .. versionadded:: 0.24.0 + File mode to use (write or append). + + .. versionadded:: 0.24.0 Attributes ---------- From b847e4e5d4b001c6749d6eeb545857d46ef7b933 Mon Sep 17 00:00:00 2001 From: thoo Date: Fri, 22 Feb 2019 10:54:54 -0500 Subject: [PATCH 24/24] fix as recommended --- pandas/core/algorithms.py | 2 +- pandas/core/indexes/base.py | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index f78ec5f936cbf..7f5feb54f601a 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -296,7 +296,7 @@ def unique(values): * Categorical : when the input is a Categorical dtype * ndarray : when the input is a Series/ndarray - Return numpy.ndarray or ExtensionArray + Return numpy.ndarray or ExtensionArray. See Also -------- diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index b0f6c8e3230e5..dacbc00b929e5 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -2971,12 +2971,10 @@ def _convert_listlike_indexer(self, keyarr, kind=None): Returns ------- - indexer, keyarr - The return can be: - - indexer : an ndarray or None if cannot convert - - keyarr : tuple-safe keys - - Return indexer, keyarr. + indexer : numpy.ndarray or None + Return an ndarray or None if cannot convert. + keyarr : numpy.ndarray + Return tuple-safe keys. """ if isinstance(keyarr, Index): keyarr = self._convert_index_indexer(keyarr)