diff --git a/pandas/core/arrays/interval.py b/pandas/core/arrays/interval.py index 38e9733723230..3c6686b5c0173 100644 --- a/pandas/core/arrays/interval.py +++ b/pandas/core/arrays/interval.py @@ -1368,7 +1368,7 @@ def closed(self) -> IntervalClosedType: Returns ------- - new_index : %(klass)s + %(klass)s %(examples)s\ """ diff --git a/pandas/core/arrays/sparse/accessor.py b/pandas/core/arrays/sparse/accessor.py index 1d5fd09034ae0..7980638deb438 100644 --- a/pandas/core/arrays/sparse/accessor.py +++ b/pandas/core/arrays/sparse/accessor.py @@ -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. diff --git a/pandas/core/dtypes/inference.py b/pandas/core/dtypes/inference.py index 3c28bd0c0a843..d607ea994543d 100644 --- a/pandas/core/dtypes/inference.py +++ b/pandas/core/dtypes/inference.py @@ -43,7 +43,7 @@ def is_number(obj) -> bool: Returns ------- - is_number : bool + bool Whether `obj` is a number or not. See Also @@ -113,7 +113,7 @@ def is_file_like(obj) -> bool: Returns ------- - is_file_like : bool + bool Whether `obj` has file-like properties. Examples @@ -141,7 +141,7 @@ def is_re(obj) -> bool: Returns ------- - is_regex : bool + bool Whether `obj` is a regex pattern. Examples @@ -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 @@ -270,7 +270,7 @@ def is_dict_like(obj) -> bool: Returns ------- - is_dict_like : bool + bool Whether `obj` has dict-like properties. Examples @@ -302,7 +302,7 @@ def is_named_tuple(obj) -> bool: Returns ------- - is_named_tuple : bool + bool Whether `obj` is a named tuple. Examples diff --git a/pandas/core/frame.py b/pandas/core/frame.py index c50c6faf89f8a..798ea8a61093a 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -8041,7 +8041,8 @@ def update( Returns ------- - None : method directly changes calling object + None + This method directly changes calling object. Raises ------ diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 46330ca22ccdb..729193fdc4261 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -724,7 +724,7 @@ def set_axis( Returns ------- - renamed : %(klass)s + %(klass)s An object of type %(klass)s. See Also @@ -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) @@ -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 @@ -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 -------- @@ -5730,7 +5730,7 @@ def pipe( Returns ------- - object : the return type of ``func``. + the return type of ``func``. See Also -------- @@ -6024,7 +6024,7 @@ def astype( Returns ------- - casted : same type as caller + same type as caller See Also -------- @@ -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 @@ -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 -------- @@ -10630,7 +10630,7 @@ def pct_change( Returns ------- - chg : Series or DataFrame + Series or DataFrame The same type as the calling object. See Also @@ -11649,7 +11649,7 @@ def first_valid_index(self) -> Hashable | None: Returns ------- - scalar : type of index + type of index Notes ----- diff --git a/pandas/core/groupby/generic.py b/pandas/core/groupby/generic.py index 02e8236524cb7..955f65585963d 100644 --- a/pandas/core/groupby/generic.py +++ b/pandas/core/groupby/generic.py @@ -540,7 +540,7 @@ def filter(self, func, dropna: bool = True, *args, **kwargs): Returns ------- - filtered : Series + Series Notes ----- @@ -1596,7 +1596,7 @@ def filter(self, func, dropna: bool = True, *args, **kwargs): Returns ------- - filtered : DataFrame + DataFrame Notes ----- diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index ab030aaa66d13..762a183dd6914 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -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 -------- @@ -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 diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index 0959f44e62576..7b8ba79789f41 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -2934,7 +2934,7 @@ def union(self, other, sort=None): Returns ------- - union : Index + Index Examples -------- @@ -3275,7 +3275,7 @@ def difference(self, other, sort=None): Returns ------- - difference : Index + Index Examples -------- @@ -3351,7 +3351,7 @@ def symmetric_difference(self, other, result_name=None, sort=None): Returns ------- - symmetric_difference : Index + Index Notes ----- @@ -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 -------- @@ -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. @@ -6119,7 +6119,7 @@ def slice_indexer( Returns ------- - indexer : slice + slice Raises ------ @@ -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 -------- diff --git a/pandas/core/indexes/datetimes.py b/pandas/core/indexes/datetimes.py index 784b5c8b24e32..bdaaeb20b3508 100644 --- a/pandas/core/indexes/datetimes.py +++ b/pandas/core/indexes/datetimes.py @@ -838,7 +838,7 @@ def date_range( Returns ------- - rng : DatetimeIndex + DatetimeIndex See Also -------- diff --git a/pandas/core/indexes/multi.py b/pandas/core/indexes/multi.py index 2c7fcf5af9a2c..97525fdead32a 100644 --- a/pandas/core/indexes/multi.py +++ b/pandas/core/indexes/multi.py @@ -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). @@ -1678,7 +1678,7 @@ def to_frame( Returns ------- - DataFrame : a DataFrame containing the original MultiIndex data. + DataFrame See Also -------- @@ -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. @@ -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 -------- diff --git a/pandas/core/resample.py b/pandas/core/resample.py index f5aeb61df633a..555b47f5e2304 100644 --- a/pandas/core/resample.py +++ b/pandas/core/resample.py @@ -374,7 +374,7 @@ def transform(self, arg, *args, **kwargs): Returns ------- - transformed : Series + Series Examples -------- diff --git a/pandas/core/reshape/merge.py b/pandas/core/reshape/merge.py index 8466db5a9e83f..dceff32108c63 100644 --- a/pandas/core/reshape/merge.py +++ b/pandas/core/reshape/merge.py @@ -428,7 +428,7 @@ def merge_asof( Returns ------- - merged : DataFrame + DataFrame See Also -------- diff --git a/pandas/core/strings/accessor.py b/pandas/core/strings/accessor.py index 9ac2e538b6a80..05fbb68e1f19b 100644 --- a/pandas/core/strings/accessor.py +++ b/pandas/core/strings/accessor.py @@ -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"}) @@ -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) @@ -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) diff --git a/pandas/io/json/_table_schema.py b/pandas/io/json/_table_schema.py index 5417a9d1d451b..db963b06d3282 100644 --- a/pandas/io/json/_table_schema.py +++ b/pandas/io/json/_table_schema.py @@ -249,7 +249,7 @@ def build_table_schema( Returns ------- - schema : dict + dict Notes ----- diff --git a/pandas/io/pickle.py b/pandas/io/pickle.py index 1d720b881525b..da998371788d5 100644 --- a/pandas/io/pickle.py +++ b/pandas/io/pickle.py @@ -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 -------- diff --git a/pandas/io/pytables.py b/pandas/io/pytables.py index 09cd989b5ca9d..8c0d5c3da385c 100644 --- a/pandas/io/pytables.py +++ b/pandas/io/pytables.py @@ -370,7 +370,7 @@ def read_hdf( Returns ------- - item : object + object The selected object. Return type depends on the object stored. See Also