diff --git a/pandas/core/algorithms.py b/pandas/core/algorithms.py index c31a2cbb41dd3..2178a01190cbc 100644 --- a/pandas/core/algorithms.py +++ b/pandas/core/algorithms.py @@ -7,7 +7,6 @@ import decimal import operator -from textwrap import dedent from typing import ( TYPE_CHECKING, Literal, @@ -35,10 +34,7 @@ TakeIndexer, npt, ) -from pandas.util._decorators import ( - doc, - set_module, -) +from pandas.util._decorators import set_module from pandas.util._exceptions import find_stack_level from pandas.core.dtypes.cast import ( @@ -654,28 +650,6 @@ def factorize_array( @set_module("pandas") -@doc( - values=dedent( - """\ - values : sequence - A 1-D sequence. Sequences that aren't pandas objects are - coerced to ndarrays before factorization. - """ - ), - sort=dedent( - """\ - sort : bool, default False - Sort `uniques` and shuffle `codes` to maintain the - relationship. - """ - ), - size_hint=dedent( - """\ - size_hint : int, optional - Hint to the hashtable sizer. - """ - ), -) def factorize( values, sort: bool = False, @@ -692,12 +666,18 @@ def factorize( Parameters ---------- - {values}{sort} + values : sequence + A 1-D sequence. Sequences that aren't pandas objects are + coerced to ndarrays before factorization. + sort : bool, default False + Sort `uniques` and shuffle `codes` to maintain the + relationship. use_na_sentinel : bool, default True If True, the sentinel -1 will be used for NaN values. If False, NaN values will be encoded as non-negative integers and will not drop the NaN from the uniques of the values. - {size_hint}\ + size_hint : int, optional + Hint to the hashtable sizer. Returns ------- diff --git a/pandas/core/base.py b/pandas/core/base.py index 200b16b4b6b1a..53ef13b3a2740 100644 --- a/pandas/core/base.py +++ b/pandas/core/base.py @@ -1279,9 +1279,7 @@ def _memory_usage(self, deep: bool = False) -> int: @doc( algorithms.factorize, - values="", order="", - size_hint="", sort=textwrap.dedent( """\ sort : bool, default False diff --git a/pandas/io/html.py b/pandas/io/html.py index d3a37ac526a41..a16c73029114b 100644 --- a/pandas/io/html.py +++ b/pandas/io/html.py @@ -24,10 +24,7 @@ AbstractMethodError, EmptyDataError, ) -from pandas.util._decorators import ( - doc, - set_module, -) +from pandas.util._decorators import set_module from pandas.util._validators import check_dtype_backend from pandas.core.dtypes.common import is_list_like @@ -36,7 +33,6 @@ from pandas.core.indexes.base import Index from pandas.core.indexes.multi import MultiIndex from pandas.core.series import Series -from pandas.core.shared_docs import _shared_docs from pandas.io.common import ( get_handle, @@ -1024,7 +1020,6 @@ def _parse( @set_module("pandas") -@doc(storage_options=_shared_docs["storage_options"]) def read_html( io: FilePath | ReadBuffer[str], *, @@ -1155,7 +1150,15 @@ def read_html( .. versionadded:: 2.0 - {storage_options} + storage_options : dict, optional + Extra options that make sense for a particular storage connection, e.g. + host, port, username, password, etc. For HTTP(S) URLs the key-value pairs + are forwarded to ``urllib.request.Request`` as header options. For other + URLs (e.g. starting with "s3://", and "gcs://") the key-value pairs are + forwarded to ``fsspec.open``. Please see ``fsspec`` and ``urllib`` for more + details, and for more examples on storage options refer `here + `_. .. versionadded:: 2.1.0