Skip to content

Commit e56dfa7

Browse files
committed
Revert "Fix some dosctring RT02 error (#50197)"
This reverts commit bce9958.
1 parent 96b7247 commit e56dfa7

File tree

15 files changed

+39
-43
lines changed

15 files changed

+39
-43
lines changed

pandas/core/arrays/interval.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1368,7 +1368,7 @@ def closed(self) -> IntervalClosedType:
13681368
13691369
Returns
13701370
-------
1371-
%(klass)s
1371+
new_index : %(klass)s
13721372
13731373
%(examples)s\
13741374
"""

pandas/core/arrays/sparse/accessor.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ def to_coo(self):
316316
317317
Returns
318318
-------
319-
scipy.sparse.spmatrix
319+
coo_matrix : scipy.sparse.spmatrix
320320
If the caller is heterogeneous and contains booleans or objects,
321321
the result will be of dtype=object. See Notes.
322322

pandas/core/dtypes/inference.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ def is_number(obj) -> bool:
4343
4444
Returns
4545
-------
46-
bool
46+
is_number : bool
4747
Whether `obj` is a number or not.
4848
4949
See Also
@@ -113,7 +113,7 @@ def is_file_like(obj) -> bool:
113113
114114
Returns
115115
-------
116-
bool
116+
is_file_like : bool
117117
Whether `obj` has file-like properties.
118118
119119
Examples
@@ -141,7 +141,7 @@ def is_re(obj) -> bool:
141141
142142
Returns
143143
-------
144-
bool
144+
is_regex : bool
145145
Whether `obj` is a regex pattern.
146146
147147
Examples
@@ -164,7 +164,7 @@ def is_re_compilable(obj) -> bool:
164164
165165
Returns
166166
-------
167-
bool
167+
is_regex_compilable : bool
168168
Whether `obj` can be compiled as a regex pattern.
169169
170170
Examples
@@ -270,7 +270,7 @@ def is_dict_like(obj) -> bool:
270270
271271
Returns
272272
-------
273-
bool
273+
is_dict_like : bool
274274
Whether `obj` has dict-like properties.
275275
276276
Examples
@@ -302,7 +302,7 @@ def is_named_tuple(obj) -> bool:
302302
303303
Returns
304304
-------
305-
bool
305+
is_named_tuple : bool
306306
Whether `obj` is a named tuple.
307307
308308
Examples

pandas/core/frame.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8041,8 +8041,7 @@ def update(
80418041
80428042
Returns
80438043
-------
8044-
None
8045-
This method directly changes calling object.
8044+
None : method directly changes calling object
80468045
80478046
Raises
80488047
------

pandas/core/generic.py

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -724,7 +724,7 @@ def set_axis(
724724
725725
Returns
726726
-------
727-
%(klass)s
727+
renamed : %(klass)s
728728
An object of type %(klass)s.
729729
730730
See Also
@@ -763,7 +763,7 @@ def swapaxes(
763763
764764
Returns
765765
-------
766-
same as input
766+
y : same as input
767767
"""
768768
i = self._get_axis_number(axis1)
769769
j = self._get_axis_number(axis2)
@@ -3712,7 +3712,7 @@ def take(self: NDFrameT, indices, axis: Axis = 0, **kwargs) -> NDFrameT:
37123712
37133713
Returns
37143714
-------
3715-
same type as caller
3715+
taken : same type as caller
37163716
An array-like containing the elements taken from the object.
37173717
37183718
See Also
@@ -4164,7 +4164,7 @@ def get(self, key, default=None):
41644164
41654165
Returns
41664166
-------
4167-
same type as items contained in object
4167+
value : same type as items contained in object
41684168
41694169
Examples
41704170
--------
@@ -5730,7 +5730,7 @@ def pipe(
57305730
57315731
Returns
57325732
-------
5733-
the return type of ``func``.
5733+
object : the return type of ``func``.
57345734
57355735
See Also
57365736
--------
@@ -6024,7 +6024,7 @@ def astype(
60246024
60256025
Returns
60266026
-------
6027-
same type as caller
6027+
casted : same type as caller
60286028
60296029
See Also
60306030
--------
@@ -6210,7 +6210,7 @@ def copy(self: NDFrameT, deep: bool_t | None = True) -> NDFrameT:
62106210
62116211
Returns
62126212
-------
6213-
Series or DataFrame
6213+
copy : Series or DataFrame
62146214
Object type matches caller.
62156215
62166216
Notes
@@ -6333,7 +6333,7 @@ def infer_objects(self: NDFrameT, copy: bool_t = True) -> NDFrameT:
63336333
63346334
Returns
63356335
-------
6336-
same type as input object
6336+
converted : same type as input object
63376337
63386338
See Also
63396339
--------
@@ -10630,7 +10630,7 @@ def pct_change(
1063010630
1063110631
Returns
1063210632
-------
10633-
Series or DataFrame
10633+
chg : Series or DataFrame
1063410634
The same type as the calling object.
1063510635
1063610636
See Also
@@ -11649,7 +11649,7 @@ def first_valid_index(self) -> Hashable | None:
1164911649
1165011650
Returns
1165111651
-------
11652-
type of index
11652+
scalar : type of index
1165311653
1165411654
Notes
1165511655
-----

pandas/core/groupby/generic.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@ def filter(self, func, dropna: bool = True, *args, **kwargs):
540540
541541
Returns
542542
-------
543-
Series
543+
filtered : Series
544544
545545
Notes
546546
-----
@@ -1596,7 +1596,7 @@ def filter(self, func, dropna: bool = True, *args, **kwargs):
15961596
15971597
Returns
15981598
-------
1599-
DataFrame
1599+
filtered : DataFrame
16001600
16011601
Notes
16021602
-----

pandas/core/groupby/groupby.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ class providing the base-class of operations.
372372
373373
Returns
374374
-------
375-
the return type of `func`.
375+
object : the return type of `func`.
376376
377377
See Also
378378
--------
@@ -774,7 +774,7 @@ def get_group(self, name, obj=None) -> DataFrame | Series:
774774
775775
Returns
776776
-------
777-
same type as obj
777+
group : same type as obj
778778
"""
779779
if obj is None:
780780
obj = self._selected_obj

pandas/core/indexes/datetimes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -838,7 +838,7 @@ def date_range(
838838
839839
Returns
840840
-------
841-
DatetimeIndex
841+
rng : DatetimeIndex
842842
843843
See Also
844844
--------

pandas/core/indexes/multi.py

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1604,7 +1604,7 @@ def get_level_values(self, level):
16041604
16051605
Returns
16061606
-------
1607-
Index
1607+
values : Index
16081608
Values is a level of this MultiIndex converted to
16091609
a single :class:`Index` (or subclass thereof).
16101610
@@ -1678,7 +1678,7 @@ def to_frame(
16781678
16791679
Returns
16801680
-------
1681-
DataFrame
1681+
DataFrame : a DataFrame containing the original MultiIndex data.
16821682
16831683
See Also
16841684
--------
@@ -2744,7 +2744,7 @@ def get_loc(self, key):
27442744
27452745
Returns
27462746
-------
2747-
int, slice object or boolean mask
2747+
loc : int, slice object or boolean mask
27482748
If the key is past the lexsort depth, the return may be a
27492749
boolean mask array, otherwise it is always a slice or int.
27502750
@@ -2862,13 +2862,10 @@ def get_loc_level(self, key, level: IndexLabel = 0, drop_level: bool = True):
28622862
28632863
Returns
28642864
-------
2865-
tuple
2866-
A 2-tuple where the elements :
2867-
2868-
Element 0: int, slice object or boolean array.
2869-
2870-
Element 1: The resulting sliced multiindex/index. If the key
2871-
contains all levels, this will be ``None``.
2865+
loc : A 2-tuple where the elements are:
2866+
Element 0: int, slice object or boolean array
2867+
Element 1: The resulting sliced multiindex/index. If the key
2868+
contains all levels, this will be ``None``.
28722869
28732870
See Also
28742871
--------

pandas/core/resample.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ def transform(self, arg, *args, **kwargs):
374374
375375
Returns
376376
-------
377-
Series
377+
transformed : Series
378378
379379
Examples
380380
--------

pandas/core/reshape/merge.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -428,7 +428,7 @@ def merge_asof(
428428
429429
Returns
430430
-------
431-
DataFrame
431+
merged : DataFrame
432432
433433
See Also
434434
--------

pandas/core/strings/accessor.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1601,7 +1601,7 @@ def pad(
16011601
16021602
Returns
16031603
-------
1604-
Series/Index of objects.
1604+
filled : Series/Index of objects.
16051605
"""
16061606

16071607
@Appender(_shared_docs["str_pad"] % {"side": "left and right", "method": "center"})
@@ -1880,7 +1880,7 @@ def encode(self, encoding, errors: str = "strict"):
18801880
18811881
Returns
18821882
-------
1883-
Series/Index of objects
1883+
encoded : Series/Index of objects
18841884
"""
18851885
result = self._data.array._str_encode(encoding, errors)
18861886
return self._wrap_result(result, returns_string=False)
@@ -2767,7 +2767,7 @@ def normalize(self, form):
27672767
27682768
Returns
27692769
-------
2770-
Series/Index of objects
2770+
normalized : Series/Index of objects
27712771
"""
27722772
result = self._data.array._str_normalize(form)
27732773
return self._wrap_result(result)

pandas/io/json/_table_schema.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ def build_table_schema(
249249
250250
Returns
251251
-------
252-
dict
252+
schema : dict
253253
254254
Notes
255255
-----

pandas/io/pickle.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def read_pickle(
141141
142142
Returns
143143
-------
144-
same type as object stored in file
144+
unpickled : same type as object stored in file
145145
146146
See Also
147147
--------

pandas/io/pytables.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -370,7 +370,7 @@ def read_hdf(
370370
371371
Returns
372372
-------
373-
object
373+
item : object
374374
The selected object. Return type depends on the object stored.
375375
376376
See Also

0 commit comments

Comments
 (0)