Skip to content
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

Fix PR10 error and Clean up docstrings from functions related to RT05 errors #25132

Merged
merged 34 commits into from Mar 1, 2019
Merged
Show file tree
Hide file tree
Changes from 33 commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
2c4455c
Fix validation error RT05
thoo Feb 4, 2019
c87102f
Fix pep8
thoo Feb 4, 2019
d552569
Merge remote-tracking branch 'upstream/master' into Rt05
thoo Feb 4, 2019
03aaa92
fix merge conflict
thoo Feb 4, 2019
36a610a
fix RT04
thoo Feb 4, 2019
c2e24b3
fix as recommended
thoo Feb 5, 2019
f5cfc8a
Merge remote-tracking branch 'upstream/master' into Rt05
thoo Feb 5, 2019
6e658f8
fix bullets
thoo Feb 5, 2019
5304b9c
fix upon suggestions
thoo Feb 6, 2019
7601aed
fix upon suggestions
thoo Feb 6, 2019
128dadb
fix failing tests
thoo Feb 6, 2019
3d3e408
replace with bullet
thoo Feb 6, 2019
522e76d
typo
thoo Feb 6, 2019
163e9e3
Retrigger :pandas-dev conda 27 failed
thoo Feb 6, 2019
b55b270
Merge remote-tracking branch 'upstream/master' into Rt05
thoo Feb 7, 2019
ba4f001
Merge remote-tracking branch 'upstream/master' into Rt05
thoo Feb 8, 2019
25e7503
update code_checks.sh
thoo Feb 8, 2019
1824b99
Merge remote-tracking branch 'upstream/master' into Rt05
thoo Feb 11, 2019
1262632
Merge remote-tracking branch 'upstream/master' into Rt05
thoo Feb 16, 2019
e12ee2a
fix as recommended
thoo Feb 16, 2019
bfe30f8
fix some leftover
thoo Feb 16, 2019
d5d270b
Retrigger :pandas-devs failed
thoo Feb 17, 2019
6ac909b
Retrigger :pandas-devs failed second time
thoo Feb 17, 2019
4e4f24a
Retrigger :pandas-devs failed second time
thoo Feb 17, 2019
283861f
Merge remote-tracking branch 'upstream/master' into Rt05
thoo Feb 17, 2019
953159c
fix at Series.unique
thoo Feb 20, 2019
15fde16
Merge remote-tracking branch 'upstream/master' into Rt05
thoo Feb 20, 2019
94e5279
add PR10
thoo Feb 21, 2019
39ab010
drop PR10
thoo Feb 21, 2019
64bd51b
fix PR10 error
thoo Feb 21, 2019
7051e3c
fix as recommended
thoo Feb 22, 2019
a35f869
Merge remote-tracking branch 'upstream/master' into Rt05
thoo Feb 22, 2019
b847e4e
fix as recommended
thoo Feb 22, 2019
2d62018
Merge remote-tracking branch 'upstream/master' into Rt05
thoo Feb 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions ci/code_checks.sh
Expand Up @@ -241,8 +241,8 @@ fi
### DOCSTRINGS ###
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then

MSG='Validate docstrings (GL06, GL07, GL09, SS04, PR03, PR05, PR10, EX04, RT04, RT05, SS05, SA05)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR04,PR05,EX04,RT04,RT05,SS05,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
Expand Down
13 changes: 9 additions & 4 deletions pandas/core/algorithms.py
Expand Up @@ -288,10 +288,15 @@ 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.
numpy.ndarray or ExtensionArray

The return can be:

* 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
--------
Expand Down
14 changes: 7 additions & 7 deletions pandas/core/arrays/categorical.py
Expand Up @@ -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.
Expand Down Expand Up @@ -1499,9 +1499,9 @@ 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
Index if datetime / periods.
"""
# if we are a datetime and period index, return Index to keep metadata
if is_datetimelike(self.categories):
Expand Down Expand Up @@ -1540,7 +1540,7 @@ def argsort(self, *args, **kwargs):

Returns
-------
argsorted : numpy array
numpy.array

See Also
--------
Expand Down Expand Up @@ -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
--------
Expand Down Expand Up @@ -1667,7 +1667,7 @@ def _values_for_rank(self):

Returns
-------
numpy array
numpy.array

"""
from pandas import Series
Expand Down Expand Up @@ -1695,7 +1695,7 @@ def ravel(self, order='C'):

Returns
-------
raveled : numpy array
numpy.array
"""
return np.array(self)

Expand Down
6 changes: 3 additions & 3 deletions pandas/core/arrays/datetimelike.py
Expand Up @@ -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
----------
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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}"
Expand Down
7 changes: 4 additions & 3 deletions pandas/core/frame.py
Expand Up @@ -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 "
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -6851,7 +6851,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.

Expand Down Expand Up @@ -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
Expand Down
32 changes: 22 additions & 10 deletions pandas/core/generic.py
Expand Up @@ -2807,21 +2807,25 @@ 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
\usepackage{multirow} to your LaTeX preamble. Will print
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
Expand Down Expand Up @@ -4948,11 +4952,15 @@ 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.
scalar, Series or DataFrame

The return can be:

* 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

Expand Down Expand Up @@ -6879,11 +6887,15 @@ 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 scalar, Series, or DataFrame.

See Also
--------
Expand Down
23 changes: 12 additions & 11 deletions pandas/core/indexes/base.py
Expand Up @@ -1442,7 +1442,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)

Expand All @@ -1460,7 +1460,7 @@ def _get_level_values(self, level):

Returns
-------
values : Index
Index
Calling object, as there is only one level in the Index.

See Also
Expand Down Expand Up @@ -1505,7 +1505,7 @@ def droplevel(self, level=0):

Returns
-------
index : Index or MultiIndex
Index or MultiIndex
"""
if not isinstance(level, (tuple, list)):
level = [level]
Expand Down Expand Up @@ -1557,11 +1557,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'])
Expand Down Expand Up @@ -2971,9 +2971,10 @@ def _convert_listlike_indexer(self, keyarr, kind=None):

Returns
-------
tuple (indexer, keyarr)
indexer is an ndarray or None if cannot convert
keyarr are tuple-safe keys
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)
Expand Down Expand Up @@ -3157,9 +3158,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.

"""

Expand Down
6 changes: 3 additions & 3 deletions pandas/core/indexes/multi.py
Expand Up @@ -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:
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -2195,7 +2195,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
Expand Down
2 changes: 2 additions & 0 deletions pandas/core/series.py
Expand Up @@ -1669,6 +1669,8 @@ def unique(self):
* Sparse
* IntegerNA

See Examples section.
thoo marked this conversation as resolved.
Show resolved Hide resolved

Examples
--------
>>> pd.Series([2, 1, 3, 3], name='A').unique()
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/excel/_base.py
Expand Up @@ -510,7 +510,7 @@ class ExcelWriter(object):
mode : {'w' or 'a'}, default 'w'
File mode to use (write or append).

.. versionadded:: 0.24.0
.. versionadded:: 0.24.0

Attributes
----------
Expand Down