Skip to content

Commit 866530b

Browse files
zangell44Pingviinituutti
authored andcommitted
Rt05 documentation error fix issue 25108 (pandas-dev#25309)
1 parent d71ddfe commit 866530b

File tree

17 files changed

+57
-52
lines changed

17 files changed

+57
-52
lines changed

ci/code_checks.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ fi
241241
### DOCSTRINGS ###
242242
if [[ -z "$CHECK" || "$CHECK" == "docstrings" ]]; then
243243

244-
MSG='Validate docstrings (GL06, GL07, GL09, SS04, PR03, PR05, PR10, EX04, RT04, SS05, SA05)' ; echo $MSG
245-
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR04,PR05,EX04,RT04,SS05,SA05
244+
MSG='Validate docstrings (GL06, GL07, GL09, SS04, PR03, PR05, PR10, EX04, RT04, RT05, SS05, SA05)' ; echo $MSG
245+
$BASE_DIR/scripts/validate_docstrings.py --format=azure --errors=GL06,GL07,GL09,SS04,PR03,PR04,PR05,EX04,RT04,RT05,SS05,SA05
246246
RET=$(($RET + $?)) ; echo $MSG "DONE"
247247

248248
fi

pandas/core/algorithms.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ def unique(values):
291291
unique values.
292292
If the input is an Index, the return is an Index
293293
If the input is a Categorical dtype, the return is a Categorical
294-
If the input is a Series/ndarray, the return will be an ndarray
294+
If the input is a Series/ndarray, the return will be an ndarray.
295295
296296
See Also
297297
--------

pandas/core/arrays/categorical.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1292,7 +1292,7 @@ def __array__(self, dtype=None):
12921292
values : numpy array
12931293
A numpy array of either the specified dtype or,
12941294
if dtype==None (default), the same dtype as
1295-
categorical.categories.dtype
1295+
categorical.categories.dtype.
12961296
"""
12971297
ret = take_1d(self.categories.values, self._codes)
12981298
if dtype and not is_dtype_equal(dtype, self.categories.dtype):

pandas/core/arrays/datetimelike.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ def strftime(self, date_format):
154154
Returns
155155
-------
156156
Index
157-
Index of formatted strings
157+
Index of formatted strings.
158158
159159
See Also
160160
--------

pandas/core/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2743,7 +2743,7 @@ def set_value(self, index, col, value, takeable=False):
27432743
-------
27442744
DataFrame
27452745
If label pair is contained, will be reference to calling DataFrame,
2746-
otherwise a new object
2746+
otherwise a new object.
27472747
"""
27482748
warnings.warn("set_value is deprecated and will be removed "
27492749
"in a future release. Please use "

pandas/core/generic.py

+9-9
Original file line numberDiff line numberDiff line change
@@ -4953,7 +4953,7 @@ def pipe(self, func, *args, **kwargs):
49534953
If DataFrame.agg is called with a single function, returns a Series
49544954
If DataFrame.agg is called with several functions, returns a DataFrame
49554955
If Series.agg is called with single function, returns a scalar
4956-
If Series.agg is called with several functions, returns a Series
4956+
If Series.agg is called with several functions, returns a Series.
49574957
49584958
%(see_also)s
49594959
@@ -5349,7 +5349,7 @@ def get_values(self):
53495349
Returns
53505350
-------
53515351
numpy.ndarray
5352-
Numpy representation of DataFrame
5352+
Numpy representation of DataFrame.
53535353
53545354
See Also
53555355
--------
@@ -5428,7 +5428,7 @@ def get_ftype_counts(self):
54285428
-------
54295429
dtype : Series
54305430
Series with the count of columns with each type and
5431-
sparsity (dense/sparse)
5431+
sparsity (dense/sparse).
54325432
54335433
See Also
54345434
--------
@@ -6657,7 +6657,7 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
66576657
-------
66586658
Series or DataFrame
66596659
Returns the same object type as the caller, interpolated at
6660-
some or all ``NaN`` values
6660+
some or all ``NaN`` values.
66616661
66626662
See Also
66636663
--------
@@ -6877,11 +6877,11 @@ def asof(self, where, subset=None):
68776877
-------
68786878
scalar, Series, or DataFrame
68796879
6880-
Scalar : when `self` is a Series and `where` is a scalar
6880+
Scalar : when `self` is a Series and `where` is a scalar.
68816881
Series: when `self` is a Series and `where` is an array-like,
6882-
or when `self` is a DataFrame and `where` is a scalar
6882+
or when `self` is a DataFrame and `where` is a scalar.
68836883
DataFrame : when `self` is a DataFrame and `where` is an
6884-
array-like
6884+
array-like.
68856885
68866886
See Also
68876887
--------
@@ -7235,7 +7235,7 @@ def clip(self, lower=None, upper=None, axis=None, inplace=False,
72357235
-------
72367236
Series or DataFrame
72377237
Same type as calling object with the values outside the
7238-
clip boundaries replaced
7238+
clip boundaries replaced.
72397239
72407240
Examples
72417241
--------
@@ -8386,7 +8386,7 @@ def ranker(data):
83868386
Returns
83878387
-------
83888388
(left, right) : (%(klass)s, type of other)
8389-
Aligned objects
8389+
Aligned objects.
83908390
""")
83918391

83928392
@Appender(_shared_docs['align'] % _shared_doc_kwargs)

pandas/core/indexes/base.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -1828,7 +1828,7 @@ def isna(self):
18281828
Returns
18291829
-------
18301830
numpy.ndarray
1831-
A boolean array of whether my values are NA
1831+
A boolean array of whether my values are NA.
18321832
18331833
See Also
18341834
--------
@@ -3098,9 +3098,9 @@ def reindex(self, target, method=None, level=None, limit=None,
30983098
Returns
30993099
-------
31003100
new_index : pd.Index
3101-
Resulting index
3101+
Resulting index.
31023102
indexer : np.ndarray or None
3103-
Indices of output values in original index
3103+
Indices of output values in original index.
31043104
31053105
"""
31063106
# GH6552: preserve names when reindexing to non-named target
@@ -4259,7 +4259,7 @@ def shift(self, periods=1, freq=None):
42594259
Returns
42604260
-------
42614261
pandas.Index
4262-
Shifted index
4262+
Shifted index.
42634263
42644264
See Also
42654265
--------
@@ -4422,7 +4422,7 @@ def set_value(self, arr, key, value):
44224422
in the target are marked by -1.
44234423
missing : ndarray of int
44244424
An indexer into the target of the values not found.
4425-
These correspond to the -1 in the indexer array
4425+
These correspond to the -1 in the indexer array.
44264426
"""
44274427

44284428
@Appender(_index_shared_docs['get_indexer_non_unique'] % _index_doc_kwargs)

pandas/core/indexes/multi.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -1956,7 +1956,7 @@ def swaplevel(self, i=-2, j=-1):
19561956
Returns
19571957
-------
19581958
MultiIndex
1959-
A new MultiIndex
1959+
A new MultiIndex.
19601960
19611961
.. versionchanged:: 0.18.1
19621962
@@ -2053,9 +2053,9 @@ def sortlevel(self, level=0, ascending=True, sort_remaining=True):
20532053
Returns
20542054
-------
20552055
sorted_index : pd.MultiIndex
2056-
Resulting index
2056+
Resulting index.
20572057
indexer : np.ndarray
2058-
Indices of output values in original index
2058+
Indices of output values in original index.
20592059
"""
20602060
from pandas.core.sorting import indexer_from_factorized
20612061

pandas/core/panel.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ def set_value(self, *args, **kwargs):
540540
-------
541541
panel : Panel
542542
If label combo is contained, will be reference to calling Panel,
543-
otherwise a new object
543+
otherwise a new object.
544544
"""
545545
warnings.warn("set_value is deprecated and will be removed "
546546
"in a future release. Please use "
@@ -803,7 +803,7 @@ def major_xs(self, key):
803803
Returns
804804
-------
805805
y : DataFrame
806-
Index -> minor axis, columns -> items
806+
Index -> minor axis, columns -> items.
807807
808808
Notes
809809
-----
@@ -827,7 +827,7 @@ def minor_xs(self, key):
827827
Returns
828828
-------
829829
y : DataFrame
830-
Index -> major axis, columns -> items
830+
Index -> major axis, columns -> items.
831831
832832
Notes
833833
-----

pandas/core/reshape/melt.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ def wide_to_long(df, stubnames, i, j, sep="", suffix=r'\d+'):
230230
-------
231231
DataFrame
232232
A DataFrame that contains each stub name as a variable, with new index
233-
(i, j)
233+
(i, j).
234234
235235
Notes
236236
-----

pandas/core/series.py

+14-10
Original file line numberDiff line numberDiff line change
@@ -1215,7 +1215,7 @@ def set_value(self, label, value, takeable=False):
12151215
-------
12161216
Series
12171217
If label is contained, will be reference to calling Series,
1218-
otherwise a new object
1218+
otherwise a new object.
12191219
"""
12201220
warnings.warn("set_value is deprecated and will be removed "
12211221
"in a future release. Please use "
@@ -1648,10 +1648,19 @@ def unique(self):
16481648
Returns
16491649
-------
16501650
ndarray or ExtensionArray
1651-
The unique values returned as a NumPy array. In case of an
1652-
extension-array backed Series, a new
1653-
:class:`~api.extensions.ExtensionArray` of that type with just
1654-
the unique values is returned. This includes
1651+
The unique values returned as a NumPy array. See Notes.
1652+
1653+
See Also
1654+
--------
1655+
unique : Top-level unique method for any 1-d array-like object.
1656+
Index.unique : Return Index with unique values from an Index object.
1657+
1658+
Notes
1659+
-----
1660+
Returns the unique values as a NumPy array. In case of an
1661+
extension-array backed Series, a new
1662+
:class:`~api.extensions.ExtensionArray` of that type with just
1663+
the unique values is returned. This includes
16551664
16561665
* Categorical
16571666
* Period
@@ -1660,11 +1669,6 @@ def unique(self):
16601669
* Sparse
16611670
* IntegerNA
16621671
1663-
See Also
1664-
--------
1665-
unique : Top-level unique method for any 1-d array-like object.
1666-
Index.unique : Return Index with unique values from an Index object.
1667-
16681672
Examples
16691673
--------
16701674
>>> pd.Series([2, 1, 3, 3], name='A').unique()

pandas/core/tools/numeric.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ def to_numeric(arg, errors='raise', downcast=None):
5959
Returns
6060
-------
6161
ret : numeric if parsing succeeded.
62-
Return type depends on input. Series if Series, otherwise ndarray
62+
Return type depends on input. Series if Series, otherwise ndarray.
6363
6464
See Also
6565
--------

pandas/core/window.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ def skew(self, **kwargs):
12711271
-------
12721272
Series or DataFrame
12731273
Returned object type is determined by the caller of the %(name)s
1274-
calculation
1274+
calculation.
12751275
12761276
See Also
12771277
--------

pandas/io/formats/style.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ def render(self, **kwargs):
435435
Returns
436436
-------
437437
rendered : str
438-
The rendered HTML
438+
The rendered HTML.
439439
440440
Notes
441441
-----

pandas/plotting/_core.py

+11-10
Original file line numberDiff line numberDiff line change
@@ -2052,9 +2052,17 @@ def plot_series(data, kind='line', ax=None, # Series unique
20522052
20532053
Returns
20542054
-------
2055-
result :
2055+
result
2056+
See Notes.
20562057
2057-
The return type depends on the `return_type` parameter:
2058+
See Also
2059+
--------
2060+
Series.plot.hist: Make a histogram.
2061+
matplotlib.pyplot.boxplot : Matplotlib equivalent plot.
2062+
2063+
Notes
2064+
-----
2065+
The return type depends on the `return_type` parameter:
20582066
20592067
* 'axes' : object of class matplotlib.axes.Axes
20602068
* 'dict' : dict of matplotlib.lines.Line2D objects
@@ -2065,13 +2073,6 @@ def plot_series(data, kind='line', ax=None, # Series unique
20652073
* :class:`~pandas.Series`
20662074
* :class:`~numpy.array` (for ``return_type = None``)
20672075
2068-
See Also
2069-
--------
2070-
Series.plot.hist: Make a histogram.
2071-
matplotlib.pyplot.boxplot : Matplotlib equivalent plot.
2072-
2073-
Notes
2074-
-----
20752076
Use ``return_type='dict'`` when you want to tweak the appearance
20762077
of the lines after plotting. In this case a dict containing the Lines
20772078
making up the boxes, caps, fliers, medians, and whiskers is returned.
@@ -3334,7 +3335,7 @@ def area(self, x=None, y=None, **kwds):
33343335
Returns
33353336
-------
33363337
matplotlib.axes.Axes or numpy.ndarray
3337-
Area plot, or array of area plots if subplots is True
3338+
Area plot, or array of area plots if subplots is True.
33383339
33393340
See Also
33403341
--------

pandas/plotting/_misc.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -390,7 +390,7 @@ def bootstrap_plot(series, fig=None, size=50, samples=500, **kwds):
390390
Returns
391391
-------
392392
fig : matplotlib.figure.Figure
393-
Matplotlib figure
393+
Matplotlib figure.
394394
395395
See Also
396396
--------

pandas/tseries/frequencies.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ def to_offset(freq):
6868
Returns
6969
-------
7070
delta : DateOffset
71-
None if freq is None
71+
None if freq is None.
7272
7373
Raises
7474
------

0 commit comments

Comments
 (0)