Skip to content

Commit fcc827d

Browse files
committed
updated subset docstring
1 parent 4e88f13 commit fcc827d

File tree

1 file changed

+10
-16
lines changed

1 file changed

+10
-16
lines changed

pandas/core/frame.py

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@
1616
import functools
1717
from io import StringIO
1818
import itertools
19-
import sys
2019
from textwrap import dedent
2120
from typing import (
2221
TYPE_CHECKING,
@@ -49,7 +48,7 @@
4948
from pandas._libs.hashtable import duplicated
5049
from pandas._libs.lib import (
5150
NoDefault,
52-
is_range_indexer,
51+
array_equal_fast,
5352
no_default,
5453
)
5554
from pandas._typing import (
@@ -92,17 +91,12 @@
9291
WriteBuffer,
9392
npt,
9493
)
95-
from pandas.compat import PYPY
9694
from pandas.compat._optional import import_optional_dependency
9795
from pandas.compat.numpy import (
9896
function as nv,
9997
np_percentile_argname,
10098
)
101-
from pandas.errors import (
102-
ChainedAssignmentError,
103-
InvalidIndexError,
104-
_chained_assignment_msg,
105-
)
99+
from pandas.errors import InvalidIndexError
106100
from pandas.util._decorators import (
107101
Appender,
108102
Substitution,
@@ -3868,10 +3862,6 @@ def isetitem(self, loc, value) -> None:
38683862
self._iset_item_mgr(loc, arraylike, inplace=False)
38693863

38703864
def __setitem__(self, key, value):
3871-
if not PYPY and using_copy_on_write():
3872-
if sys.getrefcount(self) <= 3:
3873-
raise ChainedAssignmentError(_chained_assignment_msg)
3874-
38753865
key = com.apply_if_callable(key, self)
38763866

38773867
# see if we can slice the rows
@@ -6734,7 +6724,7 @@ def sort_values(
67346724
else:
67356725
return self.copy(deep=None)
67366726

6737-
if is_range_indexer(indexer, len(indexer)):
6727+
if array_equal_fast(indexer, np.arange(0, len(indexer), dtype=indexer.dtype)):
67386728
if inplace:
67396729
return self._update_inplace(self)
67406730
else:
@@ -6932,8 +6922,8 @@ def value_counts(
69326922
69336923
Parameters
69346924
----------
6935-
subset : mapping, function, label, list of labels, optional
6936-
Columns to use when counting unique combinations.
6925+
subset : label or list of labels, optional
6926+
Column(s) to use when counting unique combinations.
69376927
normalize : bool, default False
69386928
Return proportions rather than frequencies.
69396929
sort : bool, default True
@@ -10887,7 +10877,11 @@ def quantile(
1088710877
f"Invalid method: {method}. Method must be in {valid_method}."
1088810878
)
1088910879
if method == "single":
10890-
res = data._mgr.quantile(qs=q, axis=1, interpolation=interpolation)
10880+
# error: Argument "qs" to "quantile" of "BlockManager" has incompatible type
10881+
# "Index"; expected "Float64Index"
10882+
res = data._mgr.quantile(
10883+
qs=q, axis=1, interpolation=interpolation # type: ignore[arg-type]
10884+
)
1089110885
elif method == "table":
1089210886
valid_interpolation = {"nearest", "lower", "higher"}
1089310887
if interpolation not in valid_interpolation:

0 commit comments

Comments
 (0)