Skip to content

Fix some dosctring RT02 error #50197

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

Merged
merged 4 commits into from
Dec 13, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pandas/core/arrays/interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -1368,7 +1368,7 @@ def closed(self) -> IntervalClosedType:

Returns
-------
new_index : %(klass)s
%(klass)s

%(examples)s\
"""
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/arrays/sparse/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def to_coo(self):

Returns
-------
coo_matrix : scipy.sparse.spmatrix
scipy.sparse.spmatrix
If the caller is heterogeneous and contains booleans or objects,
the result will be of dtype=object. See Notes.

Expand Down
12 changes: 6 additions & 6 deletions pandas/core/dtypes/inference.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ def is_number(obj) -> bool:

Returns
-------
is_number : bool
bool
Whether `obj` is a number or not.

See Also
Expand Down Expand Up @@ -113,7 +113,7 @@ def is_file_like(obj) -> bool:

Returns
-------
is_file_like : bool
bool
Whether `obj` has file-like properties.

Examples
Expand Down Expand Up @@ -141,7 +141,7 @@ def is_re(obj) -> bool:

Returns
-------
is_regex : bool
bool
Whether `obj` is a regex pattern.

Examples
Expand All @@ -164,7 +164,7 @@ def is_re_compilable(obj) -> bool:

Returns
-------
is_regex_compilable : bool
bool
Whether `obj` can be compiled as a regex pattern.

Examples
Expand Down Expand Up @@ -270,7 +270,7 @@ def is_dict_like(obj) -> bool:

Returns
-------
is_dict_like : bool
bool
Whether `obj` has dict-like properties.

Examples
Expand Down Expand Up @@ -302,7 +302,7 @@ def is_named_tuple(obj) -> bool:

Returns
-------
is_named_tuple : bool
bool
Whether `obj` is a named tuple.

Examples
Expand Down
3 changes: 2 additions & 1 deletion pandas/core/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -8041,7 +8041,8 @@ def update(

Returns
-------
None : method directly changes calling object
None
This method directly changes calling object.

Raises
------
Expand Down
20 changes: 10 additions & 10 deletions pandas/core/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -724,7 +724,7 @@ def set_axis(

Returns
-------
renamed : %(klass)s
%(klass)s
An object of type %(klass)s.

See Also
Expand Down Expand Up @@ -763,7 +763,7 @@ def swapaxes(

Returns
-------
y : same as input
same as input
"""
i = self._get_axis_number(axis1)
j = self._get_axis_number(axis2)
Expand Down Expand Up @@ -3712,7 +3712,7 @@ def take(self: NDFrameT, indices, axis: Axis = 0, **kwargs) -> NDFrameT:

Returns
-------
taken : same type as caller
same type as caller
An array-like containing the elements taken from the object.

See Also
Expand Down Expand Up @@ -4164,7 +4164,7 @@ def get(self, key, default=None):

Returns
-------
value : same type as items contained in object
same type as items contained in object

Examples
--------
Expand Down Expand Up @@ -5730,7 +5730,7 @@ def pipe(

Returns
-------
object : the return type of ``func``.
the return type of ``func``.

See Also
--------
Expand Down Expand Up @@ -6024,7 +6024,7 @@ def astype(

Returns
-------
casted : same type as caller
same type as caller

See Also
--------
Expand Down Expand Up @@ -6210,7 +6210,7 @@ def copy(self: NDFrameT, deep: bool_t | None = True) -> NDFrameT:

Returns
-------
copy : Series or DataFrame
Series or DataFrame
Object type matches caller.

Notes
Expand Down Expand Up @@ -6333,7 +6333,7 @@ def infer_objects(self: NDFrameT, copy: bool_t = True) -> NDFrameT:

Returns
-------
converted : same type as input object
same type as input object

See Also
--------
Expand Down Expand Up @@ -10630,7 +10630,7 @@ def pct_change(

Returns
-------
chg : Series or DataFrame
Series or DataFrame
The same type as the calling object.

See Also
Expand Down Expand Up @@ -11649,7 +11649,7 @@ def first_valid_index(self) -> Hashable | None:

Returns
-------
scalar : type of index
type of index

Notes
-----
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/groupby/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -540,7 +540,7 @@ def filter(self, func, dropna: bool = True, *args, **kwargs):

Returns
-------
filtered : Series
Series

Notes
-----
Expand Down Expand Up @@ -1596,7 +1596,7 @@ def filter(self, func, dropna: bool = True, *args, **kwargs):

Returns
-------
filtered : DataFrame
DataFrame

Notes
-----
Expand Down
4 changes: 2 additions & 2 deletions pandas/core/groupby/groupby.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,7 +372,7 @@ class providing the base-class of operations.

Returns
-------
object : the return type of `func`.
the return type of `func`.

See Also
--------
Expand Down Expand Up @@ -774,7 +774,7 @@ def get_group(self, name, obj=None) -> DataFrame | Series:

Returns
-------
group : same type as obj
same type as obj
"""
if obj is None:
obj = self._selected_obj
Expand Down
14 changes: 7 additions & 7 deletions pandas/core/indexes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -2934,7 +2934,7 @@ def union(self, other, sort=None):

Returns
-------
union : Index
Index

Examples
--------
Expand Down Expand Up @@ -3275,7 +3275,7 @@ def difference(self, other, sort=None):

Returns
-------
difference : Index
Index

Examples
--------
Expand Down Expand Up @@ -3351,7 +3351,7 @@ def symmetric_difference(self, other, result_name=None, sort=None):

Returns
-------
symmetric_difference : Index
Index

Notes
-----
Expand Down Expand Up @@ -3439,7 +3439,7 @@ def get_loc(self, key):

Returns
-------
loc : int if unique index, slice if monotonic index, else mask
int if unique index, slice if monotonic index, else mask

Examples
--------
Expand Down Expand Up @@ -3500,7 +3500,7 @@ def get_loc(self, key):

Returns
-------
indexer : np.ndarray[np.intp]
np.ndarray[np.intp]
Integers from 0 to n - 1 indicating that the index at these
positions matches the corresponding target values. Missing values
in the target are marked by -1.
Expand Down Expand Up @@ -6119,7 +6119,7 @@ def slice_indexer(

Returns
-------
indexer : slice
slice

Raises
------
Expand Down Expand Up @@ -6296,7 +6296,7 @@ def slice_locs(self, start=None, end=None, step=None) -> tuple[int, int]:

Returns
-------
start, end : int
tuple[int, int]

See Also
--------
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/indexes/datetimes.py
Original file line number Diff line number Diff line change
Expand Up @@ -838,7 +838,7 @@ def date_range(

Returns
-------
rng : DatetimeIndex
DatetimeIndex

See Also
--------
Expand Down
17 changes: 10 additions & 7 deletions pandas/core/indexes/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ def get_level_values(self, level):

Returns
-------
values : Index
Index
Values is a level of this MultiIndex converted to
a single :class:`Index` (or subclass thereof).

Expand Down Expand Up @@ -1678,7 +1678,7 @@ def to_frame(

Returns
-------
DataFrame : a DataFrame containing the original MultiIndex data.
DataFrame

See Also
--------
Expand Down Expand Up @@ -2744,7 +2744,7 @@ def get_loc(self, key):

Returns
-------
loc : int, slice object or boolean mask
int, slice object or boolean mask
If the key is past the lexsort depth, the return may be a
boolean mask array, otherwise it is always a slice or int.

Expand Down Expand Up @@ -2862,10 +2862,13 @@ def get_loc_level(self, key, level: IndexLabel = 0, drop_level: bool = True):

Returns
-------
loc : A 2-tuple where the elements are:
Element 0: int, slice object or boolean array
Element 1: The resulting sliced multiindex/index. If the key
contains all levels, this will be ``None``.
tuple
A 2-tuple where the elements :

Element 0: int, slice object or boolean array.

Element 1: The resulting sliced multiindex/index. If the key
contains all levels, this will be ``None``.

See Also
--------
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/resample.py
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ def transform(self, arg, *args, **kwargs):

Returns
-------
transformed : Series
Series

Examples
--------
Expand Down
2 changes: 1 addition & 1 deletion pandas/core/reshape/merge.py
Original file line number Diff line number Diff line change
Expand Up @@ -428,7 +428,7 @@ def merge_asof(

Returns
-------
merged : DataFrame
DataFrame

See Also
--------
Expand Down
6 changes: 3 additions & 3 deletions pandas/core/strings/accessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1601,7 +1601,7 @@ def pad(

Returns
-------
filled : Series/Index of objects.
Series/Index of objects.
"""

@Appender(_shared_docs["str_pad"] % {"side": "left and right", "method": "center"})
Expand Down Expand Up @@ -1880,7 +1880,7 @@ def encode(self, encoding, errors: str = "strict"):

Returns
-------
encoded : Series/Index of objects
Series/Index of objects
"""
result = self._data.array._str_encode(encoding, errors)
return self._wrap_result(result, returns_string=False)
Expand Down Expand Up @@ -2767,7 +2767,7 @@ def normalize(self, form):

Returns
-------
normalized : Series/Index of objects
Series/Index of objects
"""
result = self._data.array._str_normalize(form)
return self._wrap_result(result)
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/json/_table_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ def build_table_schema(

Returns
-------
schema : dict
dict

Notes
-----
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/pickle.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def read_pickle(

Returns
-------
unpickled : same type as object stored in file
same type as object stored in file

See Also
--------
Expand Down
2 changes: 1 addition & 1 deletion pandas/io/pytables.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,7 +370,7 @@ def read_hdf(

Returns
-------
item : object
object
The selected object. Return type depends on the object stored.

See Also
Expand Down