@@ -6406,7 +6406,7 @@ def dropna(
64066406
64076407 thresh : int, optional
64086408 Require that many non-NA values. Cannot be combined with how.
6409- subset : column label or sequence of labels, optional
6409+ subset : column label or iterable of labels, optional
64106410 Labels along other axis to consider, e.g. if you are dropping rows
64116411 these would be a list of columns to include.
64126412 inplace : bool, default False
@@ -6536,7 +6536,7 @@ def dropna(
65366536 @overload
65376537 def drop_duplicates (
65386538 self ,
6539- subset : Hashable | Sequence [Hashable ] | None = ...,
6539+ subset : Hashable | Iterable [Hashable ] | None = ...,
65406540 * ,
65416541 keep : DropKeep = ...,
65426542 inplace : Literal [True ],
@@ -6546,7 +6546,7 @@ def drop_duplicates(
65466546 @overload
65476547 def drop_duplicates (
65486548 self ,
6549- subset : Hashable | Sequence [Hashable ] | None = ...,
6549+ subset : Hashable | Iterable [Hashable ] | None = ...,
65506550 * ,
65516551 keep : DropKeep = ...,
65526552 inplace : Literal [False ] = ...,
@@ -6556,7 +6556,7 @@ def drop_duplicates(
65566556 @overload
65576557 def drop_duplicates (
65586558 self ,
6559- subset : Hashable | Sequence [Hashable ] | None = ...,
6559+ subset : Hashable | Iterable [Hashable ] | None = ...,
65606560 * ,
65616561 keep : DropKeep = ...,
65626562 inplace : bool = ...,
@@ -6565,7 +6565,7 @@ def drop_duplicates(
65656565
65666566 def drop_duplicates (
65676567 self ,
6568- subset : Hashable | Sequence [Hashable ] | None = None ,
6568+ subset : Hashable | Iterable [Hashable ] | None = None ,
65696569 * ,
65706570 keep : DropKeep = "first" ,
65716571 inplace : bool = False ,
@@ -6579,7 +6579,7 @@ def drop_duplicates(
65796579
65806580 Parameters
65816581 ----------
6582- subset : column label or sequence of labels, optional
6582+ subset : column label or iterable of labels, optional
65836583 Only consider certain columns for identifying duplicates, by
65846584 default use all of the columns.
65856585 keep : {'first', 'last', ``False``}, default 'first'
@@ -6669,7 +6669,7 @@ def drop_duplicates(
66696669
66706670 def duplicated (
66716671 self ,
6672- subset : Hashable | Sequence [Hashable ] | None = None ,
6672+ subset : Hashable | Iterable [Hashable ] | None = None ,
66736673 keep : DropKeep = "first" ,
66746674 ) -> Series :
66756675 """
@@ -6679,7 +6679,7 @@ def duplicated(
66796679
66806680 Parameters
66816681 ----------
6682- subset : column label or sequence of labels, optional
6682+ subset : column label or iterable of labels, optional
66836683 Only consider certain columns for identifying duplicates, by
66846684 default use all of the columns.
66856685 keep : {'first', 'last', False}, default 'first'
@@ -6771,10 +6771,7 @@ def f(vals) -> tuple[np.ndarray, int]:
67716771 return labels .astype ("i8" ), len (shape )
67726772
67736773 if subset is None :
6774- # https://github.com/pandas-dev/pandas/issues/28770
6775- # Incompatible types in assignment (expression has type "Index", variable
6776- # has type "Sequence[Any]")
6777- subset = self .columns # type: ignore[assignment]
6774+ subset = self .columns
67786775 elif (
67796776 not np .iterable (subset )
67806777 or isinstance (subset , str )
@@ -6795,7 +6792,7 @@ def f(vals) -> tuple[np.ndarray, int]:
67956792
67966793 if len (subset ) == 1 and self .columns .is_unique :
67976794 # GH#45236 This is faster than get_group_index below
6798- result = self [subset [ 0 ] ].duplicated (keep )
6795+ result = self [next ( iter ( subset )) ].duplicated (keep )
67996796 result .name = None
68006797 else :
68016798 vals = (col .values for name , col in self .items () if name in subset )
0 commit comments