Skip to content

Commit

Permalink
Rt05 documentation error fix issue 25108 (pandas-dev#25309)
Browse files Browse the repository at this point in the history
  • Loading branch information
zangell44 authored and Pingviinituutti committed Feb 28, 2019
1 parent d71ddfe commit 866530b
Show file tree
Hide file tree
Showing 17 changed files with 57 additions and 52 deletions.
4 changes: 2 additions & 2 deletions ci/code_checks.sh
Original file line number Diff line number Diff line change
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, SS05, SA05)' ; echo $MSG
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR04,PR05,EX04,RT04,SS05,SA05
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
RET=$(($RET + $?)) ; echo $MSG "DONE"

fi
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def unique(values):
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 a Series/ndarray, the return will be an ndarray.
See Also
--------
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/categorical.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/datetimelike.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ def strftime(self, date_format):
Returns
-------
Index
Index of formatted strings
Index of formatted strings.
See Also
--------
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -2743,7 +2743,7 @@ def set_value(self, index, col, value, takeable=False):
-------
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 "
Expand Down
18 changes: 9 additions & 9 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -4953,7 +4953,7 @@ def pipe(self, func, *args, **kwargs):
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 Series.agg is called with several functions, returns a Series.
%(see_also)s
Expand Down Expand Up @@ -5349,7 +5349,7 @@ def get_values(self):
Returns
-------
numpy.ndarray
Numpy representation of DataFrame
Numpy representation of DataFrame.
See Also
--------
Expand Down Expand Up @@ -5428,7 +5428,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
--------
Expand Down Expand Up @@ -6657,7 +6657,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
--------
Expand Down Expand Up @@ -6877,11 +6877,11 @@ def asof(self, where, subset=None):
-------
scalar, Series, or DataFrame
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
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
--------
Expand Down Expand Up @@ -7235,7 +7235,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
--------
Expand Down Expand Up @@ -8386,7 +8386,7 @@ def ranker(data):
Returns
-------
(left, right) : (%(klass)s, type of other)
Aligned objects
Aligned objects.
""")

@Appender(_shared_docs['align'] % _shared_doc_kwargs)
Expand Down
10 changes: 5 additions & 5 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -4259,7 +4259,7 @@ def shift(self, periods=1, freq=None):
Returns
-------
pandas.Index
Shifted index
Shifted index.
See Also
--------
Expand Down Expand Up @@ -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)
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1956,7 +1956,7 @@ def swaplevel(self, i=-2, j=-1):
Returns
-------
MultiIndex
A new MultiIndex
A new MultiIndex.
.. versionchanged:: 0.18.1
Expand Down Expand Up @@ -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

Expand Down
6 changes: 3 additions & 3 deletions pandas/core/panel.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,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 "
Expand Down Expand Up @@ -803,7 +803,7 @@ def major_xs(self, key):
Returns
-------
y : DataFrame
Index -> minor axis, columns -> items
Index -> minor axis, columns -> items.
Notes
-----
Expand All @@ -827,7 +827,7 @@ def minor_xs(self, key):
Returns
-------
y : DataFrame
Index -> major axis, columns -> items
Index -> major axis, columns -> items.
Notes
-----
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/reshape/melt.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
-----
Expand Down
24 changes: 14 additions & 10 deletions pandas/core/series.py
Original file line number Diff line number Diff line change
Expand Up @@ -1215,7 +1215,7 @@ def set_value(self, label, value, takeable=False):
-------
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 "
Expand Down Expand Up @@ -1648,10 +1648,19 @@ def unique(self):
Returns
-------
ndarray or ExtensionArray
The unique values returned as a NumPy array. In case of an
extension-array backed Series, a new
:class:`~api.extensions.ExtensionArray` of that type with just
the unique values is returned. This includes
The unique values returned as a NumPy array. See Notes.
See Also
--------
unique : Top-level unique method for any 1-d array-like object.
Index.unique : Return Index with unique values from an Index object.
Notes
-----
Returns the unique values as a NumPy array. In case of an
extension-array backed Series, a new
:class:`~api.extensions.ExtensionArray` of that type with just
the unique values is returned. This includes
* Categorical
* Period
Expand All @@ -1660,11 +1669,6 @@ def unique(self):
* Sparse
* IntegerNA
See Also
--------
unique : Top-level unique method for any 1-d array-like object.
Index.unique : Return Index with unique values from an Index object.
Examples
--------
>>> pd.Series([2, 1, 3, 3], name='A').unique()
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/tools/numeric.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/window.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/formats/style.py
Original file line number Diff line number Diff line change
Expand Up @@ -435,7 +435,7 @@ def render(self, **kwargs):
Returns
-------
rendered : str
The rendered HTML
The rendered HTML.
Notes
-----
Expand Down
21 changes: 11 additions & 10 deletions pandas/plotting/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -2052,9 +2052,17 @@ def plot_series(data, kind='line', ax=None, # Series unique
Returns
-------
result :
result
See Notes.
The return type depends on the `return_type` parameter:
See Also
--------
Series.plot.hist: Make a histogram.
matplotlib.pyplot.boxplot : Matplotlib equivalent plot.
Notes
-----
The return type depends on the `return_type` parameter:
* 'axes' : object of class matplotlib.axes.Axes
* 'dict' : dict of matplotlib.lines.Line2D objects
Expand All @@ -2065,13 +2073,6 @@ def plot_series(data, kind='line', ax=None, # Series unique
* :class:`~pandas.Series`
* :class:`~numpy.array` (for ``return_type = None``)
See Also
--------
Series.plot.hist: Make a histogram.
matplotlib.pyplot.boxplot : Matplotlib equivalent plot.
Notes
-----
Use ``return_type='dict'`` when you want to tweak the appearance
of the lines after plotting. In this case a dict containing the Lines
making up the boxes, caps, fliers, medians, and whiskers is returned.
Expand Down Expand Up @@ -3334,7 +3335,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
--------
Expand Down
2 changes: 1 addition & 1 deletion pandas/plotting/_misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
--------
Expand Down
2 changes: 1 addition & 1 deletion pandas/tseries/frequencies.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ def to_offset(freq):
Returns
-------
delta : DateOffset
None if freq is None
None if freq is None.
Raises
------
Expand Down

0 comments on commit 866530b

Please sign in to comment.