diff --git a/pandas/_libs/tslibs/timedeltas.pyx b/pandas/_libs/tslibs/timedeltas.pyx index c6b47d09cf0bd0..e21526a8f69e4a 100644 --- a/pandas/_libs/tslibs/timedeltas.pyx +++ b/pandas/_libs/tslibs/timedeltas.pyx @@ -1056,7 +1056,8 @@ cdef class _Timedelta(timedelta): See Also -------- - Timestamp.isoformat + Timestamp.isoformat : Function is used to convert the given + Timestamp object into the ISO format. Notes ----- diff --git a/pandas/core/arrays/base.py b/pandas/core/arrays/base.py index f8ff5ac18bbd9e..57f8f11d4d04c7 100644 --- a/pandas/core/arrays/base.py +++ b/pandas/core/arrays/base.py @@ -232,8 +232,8 @@ def _from_factorized(cls, values, original): See Also -------- - factorize - ExtensionArray.factorize + factorize : Top-level factorize method that dispatches here. + ExtensionArray.factorize : Encode the extension array as an enumerated type. """ raise AbstractMethodError(cls) @@ -501,7 +501,7 @@ def _values_for_argsort(self) -> np.ndarray: See Also -------- - ExtensionArray.argsort + ExtensionArray.argsort : Return the indices that would sort this array. """ # Note: this is used in `ExtensionArray.argsort`. return np.array(self) @@ -968,8 +968,8 @@ def take( See Also -------- - numpy.take - api.extensions.take + numpy.take : Take elements from an array along an axis. + api.extensions.take : Take elements from an array. Notes ----- diff --git a/pandas/core/arrays/boolean.py b/pandas/core/arrays/boolean.py index 9ffe00cf3189a1..b46e70f5a936d7 100644 --- a/pandas/core/arrays/boolean.py +++ b/pandas/core/arrays/boolean.py @@ -418,7 +418,7 @@ def _values_for_argsort(self) -> np.ndarray: See Also -------- - ExtensionArray.argsort + ExtensionArray.argsort : Return the indices that would sort this array. """ data = self._data.copy() data[self._mask] = -1 diff --git a/pandas/core/arrays/categorical.py b/pandas/core/arrays/categorical.py index 62dd3f89770cd1..499bb364c48a17 100644 --- a/pandas/core/arrays/categorical.py +++ b/pandas/core/arrays/categorical.py @@ -2061,7 +2061,7 @@ def unique(self): -------- pandas.unique CategoricalIndex.unique - Series.unique + Series.unique : Return unique values of Series object. Examples -------- diff --git a/pandas/core/arrays/datetimes.py b/pandas/core/arrays/datetimes.py index d020279ccf49d2..751290d5af9ae6 100644 --- a/pandas/core/arrays/datetimes.py +++ b/pandas/core/arrays/datetimes.py @@ -1261,8 +1261,10 @@ def isocalendar(self): See Also -------- - Timestamp.isocalendar - datetime.date.isocalendar + Timestamp.isocalendar : Function return a 3-tuple containing ISO year, + week number, and weekday for the given Timestamp object. + datetime.date.isocalendar : Return a named tuple object with + three components: year, week and weekday. Examples -------- diff --git a/pandas/core/arrays/integer.py b/pandas/core/arrays/integer.py index 88a5a88efe146c..e53276369a46fb 100644 --- a/pandas/core/arrays/integer.py +++ b/pandas/core/arrays/integer.py @@ -484,7 +484,7 @@ def _values_for_argsort(self) -> np.ndarray: See Also -------- - ExtensionArray.argsort + ExtensionArray.argsort : Return the indices that would sort this array. """ data = self._data.copy() if self._mask.any(): diff --git a/pandas/core/dtypes/base.py b/pandas/core/dtypes/base.py index 96de54380c7ad8..8630867c64f887 100644 --- a/pandas/core/dtypes/base.py +++ b/pandas/core/dtypes/base.py @@ -21,8 +21,9 @@ class ExtensionDtype: See Also -------- - extensions.register_extension_dtype - extensions.ExtensionArray + extensions.register_extension_dtype: Register an ExtensionType + with pandas as class decorator. + extensions.ExtensionArray: Abstract base class for custom 1-D array types. Notes ----- diff --git a/pandas/core/frame.py b/pandas/core/frame.py index 5e79193f103191..2664fdb31b567c 100644 --- a/pandas/core/frame.py +++ b/pandas/core/frame.py @@ -589,7 +589,7 @@ def shape(self) -> Tuple[int, int]: See Also -------- - ndarray.shape + ndarray.shape : Tuple of array dimensions. Examples -------- diff --git a/pandas/core/generic.py b/pandas/core/generic.py index 246176439d508d..fb5d1ec8fd0db9 100644 --- a/pandas/core/generic.py +++ b/pandas/core/generic.py @@ -260,7 +260,7 @@ def attrs(self) -> Dict[Optional[Hashable], Any]: See Also -------- - DataFrame.flags + DataFrame.flags : Global flags applying to this object. """ if self._attrs is None: self._attrs = {} @@ -281,8 +281,8 @@ def flags(self) -> Flags: See Also -------- - Flags - DataFrame.attrs + Flags : Flags that apply to pandas objects. + DataFrame.attrs : Global metadata applying to this dataset. Notes ----- diff --git a/pandas/core/groupby/groupby.py b/pandas/core/groupby/groupby.py index 078a1c863ad2ef..5d9028adb7372d 100644 --- a/pandas/core/groupby/groupby.py +++ b/pandas/core/groupby/groupby.py @@ -79,8 +79,9 @@ class providing the base-class of operations. _common_see_also = """ See Also -------- - Series.%(name)s - DataFrame.%(name)s + Series.%(name)s : Apply a function %(name)s to a Series. + DataFrame.%(name)s : Apply a function %(name)s + to each row or column of a DataFrame. """ _apply_docs = dict( @@ -318,9 +319,12 @@ class providing the base-class of operations. See Also -------- -%(klass)s.groupby.apply -%(klass)s.groupby.aggregate -%(klass)s.transform +%(klass)s.groupby.apply : Apply function func group-wise + and combine the results together. +%(klass)s.groupby.aggregate : Aggregate using one or more + operations over the specified axis. +%(klass)s.transform : Transforms the Series on each group + based on the given function. Notes ----- @@ -427,9 +431,12 @@ class providing the base-class of operations. See Also -------- -{klass}.groupby.apply -{klass}.groupby.transform -{klass}.aggregate +{klass}.groupby.apply : Apply function func group-wise + and combine the results together. +{klass}.groupby.transform : Aggregate using one or more + operations over the specified axis. +{klass}.aggregate : Transforms the Series on each group + based on the given function. Notes ----- @@ -1871,8 +1878,8 @@ def _fill(self, direction, limit=None): See Also -------- - pad - backfill + pad : Returns Series with minimum number of char in object. + backfill : Backward fill the missing values in the dataset. """ # Need int value for Cython if limit is None: @@ -1906,10 +1913,10 @@ def pad(self, limit=None): See Also -------- - Series.pad - DataFrame.pad - Series.fillna - DataFrame.fillna + Series.pad: Returns Series with minimum number of char in object. + DataFrame.pad: Object with missing values filled or None if inplace=True. + Series.fillna: Fill NaN values of a Series. + DataFrame.fillna: Fill NaN values of a DataFrame. """ return self._fill("ffill", limit=limit) @@ -1932,10 +1939,10 @@ def backfill(self, limit=None): See Also -------- - Series.backfill - DataFrame.backfill - Series.fillna - DataFrame.fillna + Series.backfill : Backward fill the missing values in the dataset. + DataFrame.backfill: Backward fill the missing values in the dataset. + Series.fillna: Fill NaN values of a Series. + DataFrame.fillna: Fill NaN values of a DataFrame. """ return self._fill("bfill", limit=limit) diff --git a/pandas/core/indexes/accessors.py b/pandas/core/indexes/accessors.py index 1dd85d072f2534..c97778f98387e0 100644 --- a/pandas/core/indexes/accessors.py +++ b/pandas/core/indexes/accessors.py @@ -241,8 +241,10 @@ def isocalendar(self): See Also -------- - Timestamp.isocalendar - datetime.date.isocalendar + Timestamp.isocalendar : Function return a 3-tuple containing ISO year, + week number, and weekday for the given Timestamp object. + datetime.date.isocalendar : Return a named tuple object with + three components: year, week and weekday. Examples -------- @@ -331,7 +333,8 @@ def to_pytimedelta(self) -> np.ndarray: See Also -------- - datetime.timedelta + datetime.timedelta : A duration expressing the difference + between two date, time, or datetime. Examples -------- diff --git a/pandas/core/indexes/base.py b/pandas/core/indexes/base.py index d2e4b4087b4cf9..8c9747f551c0a4 100644 --- a/pandas/core/indexes/base.py +++ b/pandas/core/indexes/base.py @@ -628,7 +628,7 @@ def ravel(self, order="C"): See Also -------- - numpy.ndarray.ravel + numpy.ndarray.ravel : Return a flattened array. """ warnings.warn( "Index.ravel returning ndarray is deprecated; in a future version " @@ -724,7 +724,8 @@ def astype(self, dtype, copy=True): See Also -------- - numpy.ndarray.take + numpy.ndarray.take: Return an array formed from the + elements of a at the given indices. """ @Appender(_index_shared_docs["take"] % _index_doc_kwargs) @@ -2324,8 +2325,8 @@ def unique(self, level=None): See Also -------- - unique - Series.unique + unique : Numpy array of unique values in that column. + Series.unique : Return unique values of Series object. """ if level is not None: self._validate_index_level(level) @@ -3968,7 +3969,7 @@ def _values(self) -> Union[ExtensionArray, np.ndarray]: See Also -------- - values + values : Values """ return self._data @@ -4259,7 +4260,8 @@ def putmask(self, mask, value): See Also -------- - numpy.ndarray.putmask + numpy.ndarray.putmask : Changes elements of an array + based on conditional and input values. """ values = self.values.copy() try: diff --git a/pandas/core/resample.py b/pandas/core/resample.py index caef938272f6fe..78d217c4688b6c 100644 --- a/pandas/core/resample.py +++ b/pandas/core/resample.py @@ -131,7 +131,7 @@ def __iter__(self): See Also -------- - GroupBy.__iter__ + GroupBy.__iter__ : Generator yielding sequence for each group. """ self._set_binner() return super().__iter__() @@ -235,9 +235,12 @@ def pipe(self, func, *args, **kwargs): """ See Also -------- - DataFrame.groupby.aggregate - DataFrame.resample.transform - DataFrame.aggregate + DataFrame.groupby.aggregate : Aggregate using callable, string, dict, + or list of string/callables. + DataFrame.resample.transform : Transforms the Series on each group + based on the given function. + DataFrame.aggregate: Aggregate using one or more + operations over the specified axis. """ ) @@ -454,8 +457,8 @@ def pad(self, limit=None): See Also -------- - Series.fillna - DataFrame.fillna + Series.fillna: Fill NA/NaN values using the specified method. + DataFrame.fillna: Fill NA/NaN values using the specified method. """ return self._upsample("pad", limit=limit) @@ -829,8 +832,8 @@ def asfreq(self, fill_value=None): See Also -------- - Series.asfreq - DataFrame.asfreq + Series.asfreq: Convert TimeSeries to specified frequency. + DataFrame.asfreq: Convert TimeSeries to specified frequency. """ return self._upsample("asfreq", fill_value=fill_value) @@ -916,8 +919,13 @@ def quantile(self, q=0.5, **kwargs): See Also -------- Series.quantile + Return a series, where the index is q and the values are the quantiles. DataFrame.quantile + Return a DataFrame, where the columns are the columns of self, + and the values are the quantiles. DataFrameGroupBy.quantile + Return a DataFrame, where the coulmns are groupby columns, + and the values are its quantiles. """ return self._downsample("quantile", q=q, **kwargs) @@ -1073,7 +1081,7 @@ def _upsample(self, method, limit=None, fill_value=None): See Also -------- - .fillna + .fillna: Fill NA/NaN values using the specified method. """ self._set_binner() @@ -1209,7 +1217,7 @@ def _upsample(self, method, limit=None, fill_value=None): See Also -------- - .fillna + .fillna: Fill NA/NaN values using the specified method. """ # we may need to actually resample as if we are timestamps diff --git a/pandas/io/formats/style.py b/pandas/io/formats/style.py index 0089d7a32f7233..2f3416cbf2d87e 100644 --- a/pandas/io/formats/style.py +++ b/pandas/io/formats/style.py @@ -829,7 +829,8 @@ def applymap(self, func: Callable, subset=None, **kwargs) -> "Styler": See Also -------- - Styler.where + Styler.where: Updates the HTML representation with a style which is + selected in accordance with the return value of a function. """ self._todo.append( (lambda instance: getattr(instance, "_applymap"), (func, subset), kwargs) @@ -870,7 +871,7 @@ def where( See Also -------- - Styler.applymap + Styler.applymap: Updates the HTML representation with the result. """ if other is None: other = "" @@ -930,7 +931,7 @@ def export(self) -> List[Tuple[Callable, Tuple, Dict]]: See Also -------- - Styler.use + Styler.use: Set the styles on the current Styler. """ return self._todo @@ -951,7 +952,7 @@ def use(self, styles: List[Tuple[Callable, Tuple, Dict]]) -> "Styler": See Also -------- - Styler.export + Styler.export : Export the styles to applied to the current Styler. """ self._todo.extend(styles) return self