Skip to content
Closed
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
38 changes: 9 additions & 29 deletions pandas/core/algorithms.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

import decimal
import operator
from textwrap import dedent
from typing import (
TYPE_CHECKING,
Literal,
Expand Down Expand Up @@ -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 (
Expand Down Expand Up @@ -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,
Expand All @@ -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
-------
Expand Down
2 changes: 0 additions & 2 deletions pandas/core/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 10 additions & 7 deletions pandas/io/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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,
Expand Down Expand Up @@ -1024,7 +1020,6 @@ def _parse(


@set_module("pandas")
@doc(storage_options=_shared_docs["storage_options"])
def read_html(
io: FilePath | ReadBuffer[str],
*,
Expand Down Expand Up @@ -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
<https://pandas.pydata.org/docs/user_guide/io.html?
highlight=storage_options#reading-writing-remote-files>`_.

.. versionadded:: 2.1.0

Expand Down
Loading