Skip to content

Commit 2c4455c

Browse files
committed
Fix validation error RT05
1 parent d3c9d6e commit 2c4455c

File tree

17 files changed

+56
-56
lines changed

17 files changed

+56
-56
lines changed

ci/code_checks.sh

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

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

247247
fi

pandas/core/algorithms.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -289,9 +289,9 @@ def unique(values):
289289
Returns
290290
-------
291291
unique values.
292-
- If the input is an Index, the return is an Index
293-
- 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
292+
- If the input is an Index, the return is an Index.
293+
- 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.
295295
296296
See Also
297297
--------

pandas/core/arrays/categorical.py

+2-2
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):
@@ -1501,7 +1501,7 @@ def get_values(self):
15011501
-------
15021502
values : numpy array
15031503
A numpy array of the same dtype as categorical.categories.dtype or
1504-
Index if datetime / periods
1504+
Index if datetime / periods.
15051505
"""
15061506
# if we are a datetime and period index, return Index to keep metadata
15071507
if is_datetimelike(self.categories):

pandas/core/arrays/datetimelike.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -144,7 +144,7 @@ def strftime(self, date_format):
144144
Return an Index of formatted strings specified by date_format, which
145145
supports the same string format as the python standard library. Details
146146
of the string format can be found in `python string format
147-
doc <%(URL)s>`__
147+
doc <%(URL)s>`__ .
148148
149149
Parameters
150150
----------
@@ -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
--------
@@ -748,7 +748,7 @@ def _maybe_mask_results(self, result, fill_value=iNaT, convert=None):
748748
mask the result if needed, convert to the provided dtype if its not
749749
None
750750
751-
This is an internal routine
751+
This is an internal routine.
752752
"""
753753

754754
if self._hasnans:
@@ -1047,7 +1047,7 @@ def _sub_period_array(self, other):
10471047
Returns
10481048
-------
10491049
result : np.ndarray[object]
1050-
Array of DateOffset objects; nulls represented by NaT
1050+
Array of DateOffset objects; nulls represented by NaT.
10511051
"""
10521052
if not is_period_dtype(self):
10531053
raise TypeError("cannot subtract {dtype}-dtype from {cls}"

pandas/core/frame.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -2797,7 +2797,7 @@ def set_value(self, index, col, value, takeable=False):
27972797
-------
27982798
frame : DataFrame
27992799
If label pair is contained, will be reference to calling DataFrame,
2800-
otherwise a new object
2800+
otherwise a new object.
28012801
"""
28022802
warnings.warn("set_value is deprecated and will be removed "
28032803
"in a future release. Please use "

pandas/core/generic.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -4951,10 +4951,10 @@ def pipe(self, func, *args, **kwargs):
49514951
Returns
49524952
-------
49534953
DataFrame, Series or scalar
4954-
if DataFrame.agg is called with a single function, returns a Series
4955-
if DataFrame.agg is called with several functions, returns a DataFrame
4956-
if Series.agg is called with single function, returns a scalar
4957-
if Series.agg is called with several functions, returns a Series
4954+
- If DataFrame.agg is called with a single function, returns a Series.
4955+
- If DataFrame.agg is called with several functions, returns a DataFrame.
4956+
- If Series.agg is called with single function, returns a scalar.
4957+
- If Series.agg is called with several functions, returns a Series.
49584958
49594959
%(see_also)s
49604960
@@ -5350,7 +5350,7 @@ def get_values(self):
53505350
Returns
53515351
-------
53525352
numpy.ndarray
5353-
Numpy representation of DataFrame
5353+
Numpy representation of DataFrame.
53545354
53555355
See Also
53565356
--------
@@ -5429,7 +5429,7 @@ def get_ftype_counts(self):
54295429
-------
54305430
dtype : Series
54315431
Series with the count of columns with each type and
5432-
sparsity (dense/sparse)
5432+
sparsity (dense/sparse).
54335433
54345434
See Also
54355435
--------
@@ -6658,7 +6658,7 @@ def replace(self, to_replace=None, value=None, inplace=False, limit=None,
66586658
-------
66596659
Series or DataFrame
66606660
Returns the same object type as the caller, interpolated at
6661-
some or all ``NaN`` values
6661+
some or all ``NaN`` values.
66626662
66636663
See Also
66646664
--------
@@ -6882,7 +6882,7 @@ def asof(self, where, subset=None):
68826882
* Series: when `self` is a Series and `where` is an array-like,
68836883
or when `self` is a DataFrame and `where` is a scalar
68846884
* DataFrame : when `self` is a DataFrame and `where` is an
6885-
array-like
6885+
array-like.
68866886
68876887
See Also
68886888
--------
@@ -7236,7 +7236,7 @@ def clip(self, lower=None, upper=None, axis=None, inplace=False,
72367236
-------
72377237
Series or DataFrame
72387238
Same type as calling object with the values outside the
7239-
clip boundaries replaced
7239+
clip boundaries replaced.
72407240
72417241
Examples
72427242
--------
@@ -8387,7 +8387,7 @@ def ranker(data):
83878387
Returns
83888388
-------
83898389
(left, right) : (%(klass)s, type of other)
8390-
Aligned objects
8390+
Aligned objects.
83918391
""")
83928392

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

pandas/core/indexes/base.py

+11-11
Original file line numberDiff line numberDiff line change
@@ -1556,11 +1556,11 @@ def droplevel(self, level=0):
15561556
Returns
15571557
-------
15581558
grouper : Index
1559-
Index of values to group on
1559+
Index of values to group on.
15601560
labels : ndarray of int or None
1561-
Array of locations in level_index
1561+
Array of locations in level_index.
15621562
uniques : Index or None
1563-
Index of unique values for level
1563+
Index of unique values for level.
15641564
"""
15651565

15661566
@Appender(_index_shared_docs['_get_grouper_for_level'])
@@ -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
--------
@@ -2972,7 +2972,7 @@ def _convert_listlike_indexer(self, keyarr, kind=None):
29722972
-------
29732973
tuple (indexer, keyarr)
29742974
indexer is an ndarray or None if cannot convert
2975-
keyarr are tuple-safe keys
2975+
keyarr are tuple-safe keys.
29762976
"""
29772977
if isinstance(keyarr, Index):
29782978
keyarr = self._convert_index_indexer(keyarr)
@@ -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
@@ -3156,9 +3156,9 @@ def _reindex_non_unique(self, target):
31563156
Returns
31573157
-------
31583158
new_index : pd.Index
3159-
Resulting index
3159+
Resulting index.
31603160
indexer : np.ndarray or None
3161-
Indices of output values in original index
3161+
Indices of output values in original index.
31623162
31633163
"""
31643164

@@ -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

+6-6
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ def _codes_to_ints(self, codes):
6161
Returns
6262
------
6363
int_keys : scalar or 1-dimensional array, of dtype uint64
64-
Integer(s) representing one combination (each)
64+
Integer(s) representing one combination (each).
6565
"""
6666
# Shift the representation of each level by the pre-calculated number
6767
# of bits:
@@ -101,7 +101,7 @@ def _codes_to_ints(self, codes):
101101
Returns
102102
------
103103
int_keys : int, or 1-dimensional array of dtype object
104-
Integer(s) representing one combination (each)
104+
Integer(s) representing one combination (each).
105105
"""
106106

107107
# Shift the representation of each level by the pre-calculated number
@@ -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

@@ -2189,7 +2189,7 @@ def reindex(self, target, method=None, level=None, limit=None,
21892189
new_index : pd.MultiIndex
21902190
Resulting index
21912191
indexer : np.ndarray or None
2192-
Indices of output values in original index
2192+
Indices of output values in original index.
21932193
21942194
"""
21952195
# GH6552: preserve names when reindexing to non-named target

pandas/core/panel.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -539,7 +539,7 @@ def set_value(self, *args, **kwargs):
539539
-------
540540
panel : Panel
541541
If label combo is contained, will be reference to calling Panel,
542-
otherwise a new object
542+
otherwise a new object.
543543
"""
544544
warnings.warn("set_value is deprecated and will be removed "
545545
"in a future release. Please use "
@@ -802,7 +802,7 @@ def major_xs(self, key):
802802
Returns
803803
-------
804804
y : DataFrame
805-
index -> minor axis, columns -> items
805+
index -> minor axis, columns -> items.
806806
807807
Notes
808808
-----
@@ -826,7 +826,7 @@ def minor_xs(self, key):
826826
Returns
827827
-------
828828
y : DataFrame
829-
index -> major axis, columns -> items
829+
index -> major axis, columns -> items.
830830
831831
Notes
832832
-----

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -1209,7 +1209,7 @@ def set_value(self, label, value, takeable=False):
12091209
-------
12101210
series : Series
12111211
If label is contained, will be reference to calling Series,
1212-
otherwise a new object
1212+
otherwise a new object.
12131213
"""
12141214
warnings.warn("set_value is deprecated and will be removed "
12151215
"in a future release. Please use "
@@ -1629,7 +1629,7 @@ def unique(self):
16291629
* Datetime with Timezone
16301630
* Interval
16311631
* Sparse
1632-
* IntegerNA
1632+
* IntegerNA .
16331633
16341634
See Also
16351635
--------

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,7 @@ def render(self, **kwargs):
433433
Returns
434434
-------
435435
rendered : str
436-
the rendered HTML
436+
The rendered HTML.
437437
438438
Notes
439439
-----
@@ -1223,7 +1223,7 @@ def from_custom_template(cls, searchpath, name):
12231223
Returns
12241224
-------
12251225
MyStyler : subclass of Styler
1226-
has the correct ``env`` and ``template`` class attributes set.
1226+
Has the correct ``env`` and ``template`` class attributes set.
12271227
"""
12281228
loader = ChoiceLoader([
12291229
FileSystemLoader(searchpath),

0 commit comments

Comments
 (0)